From b9a2951901dac21b08589c9d8b4a7eae78757726 Mon Sep 17 00:00:00 2001 From: void_17 Date: Mon, 2 Mar 2026 17:39:35 +0700 Subject: Revert "Get rid of MSVC's __int64" This reverts commit d63f79325f85e014361eb8cf1e41eaebedb1ae71. --- Minecraft.Client/Common/Consoles_App.cpp | 620 ++++++++++----------- Minecraft.Client/Common/Consoles_App.h | 66 +-- .../GameRules/ApplySchematicRuleDefinition.h | 8 +- .../Common/GameRules/ConsoleSchematicFile.cpp | 34 +- .../Common/GameRules/ConsoleSchematicFile.h | 6 +- Minecraft.Client/Common/GameRules/GameRule.h | 4 +- .../Common/GameRules/GameRuleManager.cpp | 38 +- .../Common/GameRules/LevelGenerationOptions.cpp | 30 +- .../Common/GameRules/LevelGenerationOptions.h | 12 +- .../Common/Network/GameNetworkManager.cpp | 96 ++-- .../Common/Network/GameNetworkManager.h | 18 +- .../Common/Network/Sony/SonyRemoteStorage.cpp | 30 +- .../Common/Network/Sony/SonyRemoteStorage.h | 10 +- Minecraft.Client/Common/Tutorial/Tutorial.cpp | 30 +- .../Common/UI/UIComponent_Panorama.cpp | 6 +- .../Common/UI/UIControl_SpaceIndicatorBar.cpp | 12 +- .../Common/UI/UIControl_SpaceIndicatorBar.h | 16 +- Minecraft.Client/Common/UI/UIController.cpp | 60 +- Minecraft.Client/Common/UI/UIController.h | 16 +- Minecraft.Client/Common/UI/UIGroup.cpp | 16 +- Minecraft.Client/Common/UI/UIGroup.h | 12 +- Minecraft.Client/Common/UI/UILayer.cpp | 34 +- Minecraft.Client/Common/UI/UILayer.h | 8 +- Minecraft.Client/Common/UI/UIScene.cpp | 50 +- Minecraft.Client/Common/UI/UIScene.h | 16 +- .../Common/UI/UIScene_CreateWorldMenu.cpp | 68 +-- Minecraft.Client/Common/UI/UIScene_LoadMenu.h | 14 +- .../Common/UI/UIScene_LoadOrJoinMenu.cpp | 136 ++--- .../Common/XUI/XUI_MultiGameCreate.cpp | 94 ++-- .../Common/XUI/XUI_MultiGameJoinLoad.cpp | 180 +++--- Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp | 102 ++-- Minecraft.Client/Common/zlib/zconf.h | 2 +- 32 files changed, 922 insertions(+), 922 deletions(-) (limited to 'Minecraft.Client/Common') diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index 0e55ec9f..b047f58e 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -198,11 +198,11 @@ CMinecraftApp::CMinecraftApp() m_dwRequiredTexturePackID=0; m_bResetNether=false; - + #ifdef _XBOX // m_bTransferSavesToXboxOne=false; // m_uiTransferSlotC=5; -#endif +#endif #if (defined _CONTENT_PACAKGE) || (defined _XBOX) m_bUseDPadForDebug = false; @@ -219,7 +219,7 @@ CMinecraftApp::CMinecraftApp() for(int i=0;i; + m_vBannedListA[i] = new vector; } LocaleAndLanguageInit(); @@ -265,7 +265,7 @@ void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...) { SceUID tty2 = sceIoOpen("tty2:", SCE_O_WRONLY, 0); if(tty2>=0) - { + { std::string string1(buf); sceIoWrite(tty2, string1.c_str(), string1.length()); sceIoClose(tty2); @@ -276,7 +276,7 @@ void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...) { SceUID tty3 = sceIoOpen("tty3:", SCE_O_WRONLY, 0); if(tty3>=0) - { + { std::string string1(buf); sceIoWrite(tty3, string1.c_str(), string1.length()); sceIoClose(tty3); @@ -318,7 +318,7 @@ void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param) m_eXuiAction[iPad]=action; m_eXuiActionParam[iPad] = param; } -} +} bool CMinecraftApp::IsAppPaused() { @@ -354,7 +354,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad) // // test an update of the profile data // void *pData=ProfileManager.GetGameDefinedProfileData(iPad); -// +// // unsigned char *pchData= (unsigned char *)pData; // int iCount=0; // for(int i=0;i player, CraftingPanelScreenInput* initData = new CraftingPanelScreenInput(); initData->player = player; - initData->iContainerType=RECIPE_TYPE_3x3; + initData->iContainerType=RECIPE_TYPE_3x3; initData->iPad = iPad; initData->x = x; initData->y = y; @@ -550,7 +550,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr inventory, initData->container = container; initData->iPad = iPad; - // Load the scene. + // Load the scene. if(app.GetLocalPlayerCount()>1) { initData->bSplitscreen=true; @@ -780,7 +780,7 @@ int CMinecraftApp::DefaultOptionsCallback(LPVOID pParam,C_4JProfile::PROFILESETT pApp->DebugPrintf("Setting default options for player %d", iPad); pApp->SetAction(iPad,eAppAction_SetDefaultOptions, (LPVOID)pSettings); //pApp->SetDefaultOptions(pSettings,iPad); - + // if the profile data has been changed, then force a profile write // It seems we're allowed to break the 5 minute rule if it's the result of a user action //pApp->CheckGameSettingsChanged(); @@ -834,7 +834,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat case PROFILE_VERSION_1: case PROFILE_VERSION_2: // need to fill in values for the new profile data. No need to save the profile - that'll happen if they get changed, or if the auto save for the profile kicks in - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->ucMenuSensitivity=100; //eGameSetting_Sensitivity_InMenu pGameSettings->ucInterfaceOpacity=80; //eGameSetting_Sensitivity_InMenu @@ -880,7 +880,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_3: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->uiBitmaskValues=0L; // reset pGameSettings->uiBitmaskValues|=GAMESETTING_CLOUDS; //eGameSetting_Clouds - on @@ -917,7 +917,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat case PROFILE_VERSION_4: { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; - + pGameSettings->uiBitmaskValues&=~GAMESETTING_BEDROCKFOG; //eGameSetting_BedrockFog - off pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYHUD; //eGameSetting_DisplayHUD - on pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYHAND; //eGameSetting_DisplayHand - on @@ -1014,7 +1014,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_7: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; // reset the display new message counter pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) @@ -1037,7 +1037,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; #endif case PROFILE_VERSION_8: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; // reset the display new message counter //pGameSettings->uiBitmaskValues|=GAMESETTING_DISPLAYUPDATEMSG; //eGameSetting_DisplayUpdateMessage (counter) @@ -1055,17 +1055,17 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; case PROFILE_VERSION_9: // PS3DEC13 - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->uiBitmaskValues&=~GAMESETTING_PS3EULAREAD; //eGameSetting_PS3_EULA_Read - off - + // PS3 1.05 - added Greek pGameSettings->ucLanguage = MINECRAFT_LANGUAGE_DEFAULT; // use the system language } break; case PROFILE_VERSION_10: - { + { GAME_SETTINGS *pGameSettings=(GAME_SETTINGS *)pucData; pGameSettings->ucLanguage = MINECRAFT_LANGUAGE_DEFAULT; // use the system language @@ -1073,7 +1073,7 @@ int CMinecraftApp::OldProfileVersionCallback(LPVOID pParam,unsigned char *pucDat break; default: - { + { // 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 @@ -1175,7 +1175,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) if(iPad==ProfileManager.GetPrimaryPad()) { pMinecraft->options->set(Options::Option::SOUND,((float)GameSettingsA[iPad]->ucSoundFXVolume)/100.0f); - } + } break; case eGameSetting_Gamma: if(iPad==ProfileManager.GetPrimaryPad()) @@ -1183,10 +1183,10 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) // ucGamma range is 0-100, UpdateGamma is 0 - 32768 float fVal=((float)GameSettingsA[iPad]->ucGamma)*327.68f; RenderManager.UpdateGamma((unsigned short)fVal); - } + } break; - case eGameSetting_Difficulty: + case eGameSetting_Difficulty: if(iPad==ProfileManager.GetPrimaryPad()) { pMinecraft->options->toggle(Options::Option::DIFFICULTY,GameSettingsA[iPad]->usBitmaskValues&0x03); @@ -1208,7 +1208,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) { app.DebugPrintf("NOT ACTIONING DIFFICULTY - Primary pad is %d, This pad is %d\n",ProfileManager.GetPrimaryPad(),iPad); } - + break; case eGameSetting_Sensitivity_InGame: // 4J-PB - we don't use the options value @@ -1335,7 +1335,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal) //nothing to do here break; case eGameSetting_BedrockFog: - { + { bool bInGame=pMinecraft->level!=NULL; // Game Host only @@ -1414,8 +1414,8 @@ DWORD CMinecraftApp::GetPlayerSkinId(int iPad) { // 4J Stu - DLC skins are numbered using decimal rather than hex to make it easier to number manually swprintf(chars, 256, L"dlcskin%08d.png", GET_DLC_SKIN_ID_FROM_BITMASK(dwSkin)); - - Pack=app.m_dlcManager.getPackContainingSkin(chars); + + Pack=app.m_dlcManager.getPackContainingSkin(chars); if(Pack) { @@ -1518,7 +1518,7 @@ unsigned int CMinecraftApp::GetPlayerFavoriteSkinsCount(int iPad) void CMinecraftApp::ValidateFavoriteSkins(int iPad) { unsigned int uiCount=GetPlayerFavoriteSkinsCount(iPad); - + // remove invalid skins unsigned int uiValidSkin=0; wchar_t chars[256]; @@ -1539,7 +1539,7 @@ void CMinecraftApp::ValidateFavoriteSkins(int iPad) if( pDLCPack->hasPurchasedFile(DLCManager::e_DLCType_Skin, L"") || (pSkinFile && pSkinFile->isFree())) { - GameSettingsA[iPad]->uiFavoriteSkinA[uiValidSkin++]=GameSettingsA[iPad]->uiFavoriteSkinA[i]; + GameSettingsA[iPad]->uiFavoriteSkinA[uiValidSkin++]=GameSettingsA[iPad]->uiFavoriteSkinA[i]; } } } @@ -1560,7 +1560,7 @@ void CMinecraftApp::HideMashupPackWorld(int iPad, unsigned int iMashupPackID) void CMinecraftApp::SetMinecraftLanguage(int iPad, unsigned char ucLanguage) { - GameSettingsA[iPad]->ucLanguage = ucLanguage; + GameSettingsA[iPad]->ucLanguage = ucLanguage; GameSettingsA[iPad]->bSettingsChanged = true; } @@ -1612,7 +1612,7 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV if(iPad==ProfileManager.GetPrimaryPad()) { ActionGameSettings(iPad,eVal); - } + } GameSettingsA[iPad]->bSettingsChanged=true; } break; @@ -1627,7 +1627,7 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; - case eGameSetting_Difficulty: + case eGameSetting_Difficulty: if((GameSettingsA[iPad]->usBitmaskValues&0x03)!=(ucVal&0x03)) { GameSettingsA[iPad]->usBitmaskValues&=~0x03; @@ -1972,9 +1972,9 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; - case eGameSetting_UISize: + } + break; + case eGameSetting_UISize: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE)!=((ucVal&0x03)<<11)) { GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_UISIZE; @@ -1986,7 +1986,7 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV GameSettingsA[iPad]->bSettingsChanged=true; } break; - case eGameSetting_UISizeSplitscreen: + case eGameSetting_UISizeSplitscreen: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_UISIZE_SPLITSCREEN)!=((ucVal&0x03)<<13)) { GameSettingsA[iPad]->uiBitmaskValues&=~GAMESETTING_UISIZE_SPLITSCREEN; @@ -2011,8 +2011,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; case eGameSetting_PS3_EULA_Read: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PS3EULAREAD)!=(ucVal&0x01)<<16) { @@ -2026,8 +2026,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; case eGameSetting_PSVita_NetworkModeAdhoc: if((GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_PSVITANETWORKMODEADHOC)!=(ucVal&0x01)<<17) { @@ -2041,8 +2041,8 @@ void CMinecraftApp::SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucV } ActionGameSettings(iPad,eVal); GameSettingsA[iPad]->bSettingsChanged=true; - } - break; + } + break; } } @@ -2067,7 +2067,7 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_Gamma: return GameSettingsA[iPad]->ucGamma; break; - case eGameSetting_Difficulty: + case eGameSetting_Difficulty: return GameSettingsA[iPad]->usBitmaskValues&0x0003; break; case eGameSetting_Sensitivity_InGame: @@ -2116,7 +2116,7 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) case eGameSetting_InterfaceOpacity: return GameSettingsA[iPad]->ucInterfaceOpacity; break; - + case eGameSetting_Clouds: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_CLOUDS); break; @@ -2131,7 +2131,7 @@ unsigned char CMinecraftApp::GetGameSettings(int iPad,eGameSetting eVal) break; case eGameSetting_DisplayUpdateMessage: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_DISPLAYUPDATEMSG)>>4; - break; + break; case eGameSetting_BedrockFog: return (GameSettingsA[iPad]->uiBitmaskValues&GAMESETTING_BEDROCKFOG)>>6; break; @@ -2457,13 +2457,13 @@ void CMinecraftApp::HandleXuiActions(void) param = m_eXuiActionParam[i]; if(eAction!=eAppAction_Idle) - { + { switch(eAction) { // the renderer will capture a screenshot case eAppAction_SocialPost: if(ProfileManager.IsFullVersion()) - { + { // Facebook Share if( CSocialManager::Instance()->IsTitleAllowedToPostImages() && CSocialManager::Instance()->AreAllUsersAllowedToPostImages() ) { @@ -2523,7 +2523,7 @@ void CMinecraftApp::HandleXuiActions(void) else { // ask the player if they would like to upgrade, or they'll lose the level - + UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -2533,7 +2533,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_AutosaveSaveGame: - { + { // Need to run a check to see if the save exists in order to stop the dialog asking if we want to overwrite it coming up on an autosave bool bSaveExists; StorageManager.DoesSaveExist(&bSaveExists); @@ -2543,7 +2543,7 @@ void CMinecraftApp::HandleXuiActions(void) { // flag the render to capture the screenshot for the save - SetAction(i,eAppAction_AutosaveSaveGameCapturedThumbnail); + SetAction(i,eAppAction_AutosaveSaveGameCapturedThumbnail); } } @@ -2569,7 +2569,7 @@ void CMinecraftApp::HandleXuiActions(void) //INT saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); - + LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc; loadingParams->lpParam = (LPVOID)false; @@ -2593,7 +2593,7 @@ void CMinecraftApp::HandleXuiActions(void) } loadingParams->completionData = completionData; - + // 4J Stu - Xbox only #ifdef _XBOX // Temporarily make this scene fullscreen @@ -2606,7 +2606,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_AutosaveSaveGameCapturedThumbnail: - { + { app.SetAutosaveTimerTime(); SetAction(i,eAppAction_Idle); @@ -2624,12 +2624,12 @@ void CMinecraftApp::HandleXuiActions(void) // This just allows it to be shown if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != NULL) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(false); - + //INT saveOrCheckpointId = 0; //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); //SentientManager.RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId); - + LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::SaveWorldThreadProc; @@ -2642,7 +2642,7 @@ void CMinecraftApp::HandleXuiActions(void) completionData->iPad = ProfileManager.GetPrimaryPad(); //completionData->bAutosaveWasMenuDisplayed=ui.GetMenuDisplayed(ProfileManager.GetPrimaryPad()); loadingParams->completionData = completionData; - + // 4J Stu - Xbox only #ifdef _XBOX // Temporarily make this scene fullscreen @@ -2656,7 +2656,7 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_ExitPlayer: // a secondary player has chosen to quit { - int iPlayerC=g_NetworkManager.GetPlayerCount(); + int iPlayerC=g_NetworkManager.GetPlayerCount(); // Since the player is exiting, let's flush any profile writes for them, and hope we're not breaking TCR 136... #if (defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) @@ -2677,7 +2677,7 @@ void CMinecraftApp::HandleXuiActions(void) // not required - it's done within the removeLocalPlayerIdx // if(pMinecraft->level->isClientSide) - // { + // { // // we need to remove the qnetplayer, or this player won't be able to get back into the game until qnet times out and removes them // g_NetworkManager.NotifyPlayerLeaving(g_NetworkManager.GetLocalPlayerByUserIndex(i)); // } @@ -2716,9 +2716,9 @@ void CMinecraftApp::HandleXuiActions(void) if(iPlayerC>2) // one player is about to leave here - they'll be set to idle in the qnet manager player leave { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false); @@ -2733,9 +2733,9 @@ void CMinecraftApp::HandleXuiActions(void) else { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); @@ -2747,11 +2747,11 @@ void CMinecraftApp::HandleXuiActions(void) } } } - + #ifdef _DURANGO ProfileManager.RemoveGamepadFromGame(i); -#endif - +#endif + SetAction(i,eAppAction_Idle); } break; @@ -2763,7 +2763,7 @@ void CMinecraftApp::HandleXuiActions(void) StorageManager.ForceQueuedProfileWrites(i); #else ProfileManager.ForceQueuedProfileWrites(i); -#endif +#endif // if there are any tips showing, we need to close them pMinecraft->gui->clearMessages(i); @@ -2798,9 +2798,9 @@ void CMinecraftApp::HandleXuiActions(void) if(iPlayerC>2) // one player is about to leave here - they'll be set to idle in the qnet manager player leave { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYEROFFLINE,false); @@ -2815,9 +2815,9 @@ void CMinecraftApp::HandleXuiActions(void) else { for(int iPlayer=0;iPlayerlocalplayers[iPlayer]) - { + { if(g_NetworkManager.IsLocalGame()) { ProfileManager.SetCurrentGameActivity(iPlayer,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); @@ -2872,7 +2872,7 @@ void CMinecraftApp::HandleXuiActions(void) SetAction(i,eAppAction_Idle); // If we're already leaving don't exit - if (g_NetworkManager.IsLeavingGame()) + if (g_NetworkManager.IsLeavingGame()) { break; } @@ -2903,7 +2903,7 @@ void CMinecraftApp::HandleXuiActions(void) Minecraft::GetInstance()->forceStatsSave(j); } } - LeaderboardManager::Instance()->CloseSession(); + LeaderboardManager::Instance()->CloseSession(); #elif (defined _XBOX) ProfileManager.ForceQueuedProfileWrites(); #endif @@ -2923,7 +2923,7 @@ void CMinecraftApp::HandleXuiActions(void) #ifdef _DURANGO ProfileManager.RemoveGamepadFromGame(i); -#endif +#endif SetAction(i,eAppAction_Idle); return; } @@ -2941,13 +2941,13 @@ void CMinecraftApp::HandleXuiActions(void) // Change the presence info // Are we offline or online, and how many players are there - + if(g_NetworkManager.GetPlayerCount()>1) { for(int j=0;jlocalplayers[j]) - { + { if(g_NetworkManager.IsLocalGame()) { app.SetRichPresenceContext(j,CONTEXT_GAME_STATE_BLANK); @@ -2966,7 +2966,7 @@ void CMinecraftApp::HandleXuiActions(void) { app.SetRichPresenceContext(i,CONTEXT_GAME_STATE_BLANK); if(g_NetworkManager.IsLocalGame()) - { + { ProfileManager.SetCurrentGameActivity(i,CONTEXT_PRESENCE_MULTIPLAYER_1POFFLINE,false); } else @@ -2987,14 +2987,14 @@ void CMinecraftApp::HandleXuiActions(void) // turn off the gamertags in splitscreen for the primary player, since they are about to be made fullscreen ui.HideAllGameUIElements(); - + // 4J Stu - Fix for #12368 - Crash: Game crashes when saving then exiting and selecting to save for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { #ifdef _XBOX app.TutorialSceneNavigateBack(idx,true); #endif - + // 4J Stu - Fix for #13257 - CRASH: Gameplay: Title crashed after exiting the tutorial // It doesn't matter if they were in the tutorial already pMinecraft->playerLeftTutorial( idx ); @@ -3002,7 +3002,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::ExitWorldThreadProc; - loadingParams->lpParam = param; + loadingParams->lpParam = param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); // If param is non-null then this is a forced exit by the server, so make sure the player knows why @@ -3015,11 +3015,11 @@ void CMinecraftApp::HandleXuiActions(void) completionData->iPad = DEFAULT_XUI_MENU_USER; loadingParams->completionData = completionData; - ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } break; case eAppAction_ExitWorldTrial: - { + { SetAction(i,eAppAction_Idle); pMinecraft->gui->clearMessages(); @@ -3031,14 +3031,14 @@ void CMinecraftApp::HandleXuiActions(void) SetGameStarted(false); ui.CloseAllPlayersScenes(); - + // 4J Stu - Fix for #12368 - Crash: Game crashes when saving then exiting and selecting to save for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { #ifdef _XBOX app.TutorialSceneNavigateBack(idx,true); #endif - + // 4J Stu - Fix for #13257 - CRASH: Gameplay: Title crashed after exiting the tutorial // It doesn't matter if they were in the tutorial already pMinecraft->playerLeftTutorial( idx ); @@ -3046,7 +3046,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &UIScene_PauseMenu::ExitWorldThreadProc; - loadingParams->lpParam = param; + loadingParams->lpParam = param; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3054,7 +3054,7 @@ void CMinecraftApp::HandleXuiActions(void) completionData->type = e_ProgressCompletion_NavigateToHomeMenu; completionData->iPad = DEFAULT_XUI_MENU_USER; loadingParams->completionData = completionData; - + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } @@ -3072,7 +3072,7 @@ void CMinecraftApp::HandleXuiActions(void) param->showTooltips = false; param->setFailTimer = false; ui.NavigateToScene(i,eUIScene_ConnectingProgress, param); - + // Need to reset this incase the player has already died and respawned pMinecraft->localplayers[i]->SetPlayerRespawned(false); @@ -3100,7 +3100,7 @@ void CMinecraftApp::HandleXuiActions(void) // Disable game & update thread whilst we do any of this //app.SetGameStarted(false); pMinecraft->gameRenderer->DisableUpdateThread(); - + // 4J Stu - We don't need this on a thread in multiplayer as respawning is asynchronous. pMinecraft->localplayers[i]->respawn(); @@ -3116,7 +3116,7 @@ void CMinecraftApp::HandleXuiActions(void) //app.NavigateToScene(i,eUIScene_FullscreenProgress, loadingParams, true); } - } + } break; case eAppAction_WaitForRespawnComplete: player = pMinecraft->localplayers[i]; @@ -3156,8 +3156,8 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_PrimaryPlayerSignedOut: - { - //SetAction(i,eAppAction_Idle); + { + //SetAction(i,eAppAction_Idle); // clear the autosavetimer that might be displayed ui.ShowAutosaveCountdownTimer(false); @@ -3175,10 +3175,10 @@ void CMinecraftApp::HandleXuiActions(void) // 4J-PB - the libs will display the Returned to Title screen // UINT uiIDA[1]; // uiIDA[0]=IDS_CONFIRM_OK; -// +// // ui.RequestMessageBox(IDS_RETURNEDTOMENU_TITLE, IDS_RETURNEDTOTITLESCREEN_TEXT, uiIDA, 1, i,&CMinecraftApp::PrimaryPlayerSignedOutReturned,this,app.GetStringTable()); if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(i,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -3226,7 +3226,7 @@ void CMinecraftApp::HandleXuiActions(void) if (!gameStarted) { - // 1. Exit + // 1. Exit MinecraftServer::HaltServer(); // Fix for #12530 - TCR 001 BAS Game Stability: Title will crash if the player disconnects while starting a new world and then opts to play the tutorial once they have been returned to the Main Menu. @@ -3294,21 +3294,21 @@ void CMinecraftApp::HandleXuiActions(void) ui.HideAllGameUIElements(); ui.CloseAllPlayersScenes(); - + // 4J Stu - Fix for #12368 - Crash: Game crashes when saving then exiting and selecting to save for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { #ifdef _XBOX app.TutorialSceneNavigateBack(idx,true); #endif - + // 4J Stu - Fix for #13257 - CRASH: Gameplay: Title crashed after exiting the tutorial // It doesn't matter if they were in the tutorial already pMinecraft->playerLeftTutorial( idx ); } LoadingInputParams *loadingParams = new LoadingInputParams(); - loadingParams->func = &CMinecraftApp::SignoutExitWorldThreadProc; + loadingParams->func = &CMinecraftApp::SignoutExitWorldThreadProc; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3346,7 +3346,7 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_TrialOver: - { + { SetAction(i,eAppAction_Idle); UINT uiIDA[2]; uiIDA[0]=IDS_UNLOCK_TITLE; @@ -3358,7 +3358,7 @@ void CMinecraftApp::HandleXuiActions(void) // INVITES case eAppAction_DashboardTrialJoinFromInvite: - { + { TelemetryManager->RecordUpsellPresented(i, eSen_UpsellID_Full_Version_Of_Game, app.m_dwOfferID); SetAction(i,eAppAction_Idle); @@ -3370,7 +3370,7 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_ExitAndJoinFromInvite: - { + { UINT uiIDA[3]; SetAction(i,eAppAction_Idle); @@ -3379,7 +3379,7 @@ void CMinecraftApp::HandleXuiActions(void) #if defined(_XBOX_ONE) || defined(__ORBIS__) // Show save option is saves ARE disabled if(ProfileManager.IsFullVersion() && StorageManager.GetSaveDisabled() && i==ProfileManager.GetPrimaryPad() && g_NetworkManager.IsHost() && GetGameStarted() ) - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; @@ -3389,7 +3389,7 @@ void CMinecraftApp::HandleXuiActions(void) else #else if(ProfileManager.IsFullVersion() && !StorageManager.GetSaveDisabled() && i==ProfileManager.GetPrimaryPad() && g_NetworkManager.IsHost() && GetGameStarted() ) - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_EXIT_GAME_SAVE; uiIDA[2]=IDS_EXIT_GAME_NO_SAVE; @@ -3409,7 +3409,7 @@ void CMinecraftApp::HandleXuiActions(void) ui.RequestMessageBox(IDS_UNLOCK_TITLE, IDS_UNLOCK_ACCEPT_INVITE, uiIDA, 2, i,&CMinecraftApp::UnlockFullInviteReturned,this,app.GetStringTable()); } else - { + { uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; ui.RequestMessageBox(IDS_EXIT_GAME, IDS_CONFIRM_LEAVE_VIA_INVITE, uiIDA, 2,i,&CMinecraftApp::ExitAndJoinFromInvite,this,app.GetStringTable(), 0, 0, false); @@ -3430,14 +3430,14 @@ void CMinecraftApp::HandleXuiActions(void) SetGameStarted(false); ui.CloseAllPlayersScenes(); - + // 4J Stu - Fix for #12368 - Crash: Game crashes when saving then exiting and selecting to save for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { #ifdef _XBOX app.TutorialSceneNavigateBack(idx,true); #endif - + // 4J Stu - Fix for #13257 - CRASH: Gameplay: Title crashed after exiting the tutorial // It doesn't matter if they were in the tutorial already pMinecraft->playerLeftTutorial( idx ); @@ -3497,7 +3497,7 @@ void CMinecraftApp::HandleXuiActions(void) if(ProfileManager.IsSignedIn(index) ) { if(index==i || pMinecraft->localplayers[index]!=NULL ) - { + { m_InviteData.dwLocalUsersMask |= g_NetworkManager.GetLocalPlayerMask( index ); } } @@ -3506,7 +3506,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::ExitAndJoinFromInviteThreadProc; - loadingParams->lpParam = (LPVOID)&m_InviteData; + loadingParams->lpParam = (LPVOID)&m_InviteData; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bShowBackground=TRUE; @@ -3544,7 +3544,7 @@ void CMinecraftApp::HandleXuiActions(void) if( index != inviteData->dwUserIndex && ProfileManager.IsSignedIn(index) ) { if( (m_InviteData.dwLocalUsersMask & g_NetworkManager.GetLocalPlayerMask( index ) ) == 0 ) - { + { ProfileManager.RemoveGamepadFromGame(index); } } @@ -3568,7 +3568,7 @@ void CMinecraftApp::HandleXuiActions(void) UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; ui.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); - + ui.NavigateToHomeMenu(); ui.UpdatePlayerBasePositions(); } @@ -3580,12 +3580,12 @@ void CMinecraftApp::HandleXuiActions(void) if( g_NetworkManager.IsInGameplay() ) { // This kicks off a thread that waits for the server to end, then closes the current session, starts a new one and joins the local players into it - + SetAction(i,eAppAction_Idle); if( !GetChangingSessionType() && !g_NetworkManager.IsLocalGame() ) { - SetGameStarted(false); + SetGameStarted(false); SetChangingSessionType(true); SetReallyChangingSessionType(true); @@ -3597,14 +3597,14 @@ void CMinecraftApp::HandleXuiActions(void) ui.CloseAllPlayersScenes(); } ui.ShowOtherPlayersBaseScene(ProfileManager.GetPrimaryPad(), true); - + // Remove this line to fix: // #49084 - TU5: Code: Gameplay: The title crashes every time client navigates to 'Play game' menu and loads/creates new game after a "Connection to Xbox LIVE was lost" message has appeared. //app.NavigateToScene(0,eUIScene_Main); - + LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CGameNetworkManager::ChangeSessionTypeThreadProc; - loadingParams->lpParam = NULL; + loadingParams->lpParam = NULL; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); #ifdef __PS3__ @@ -3626,7 +3626,7 @@ void CMinecraftApp::HandleXuiActions(void) } loadingParams->completionData = completionData; - ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } } else if( g_NetworkManager.IsLeavingGame() ) @@ -3653,9 +3653,9 @@ void CMinecraftApp::HandleXuiActions(void) case eAppAction_SetDefaultOptions: SetAction(i,eAppAction_Idle); #if ( defined __PS3__ || defined __ORBIS__ || defined _DURANGO || defined __PSVITA__) - SetDefaultOptions((C4JStorage::PROFILESETTINGS *)param,i); + SetDefaultOptions((C4JStorage::PROFILESETTINGS *)param,i); #else - SetDefaultOptions((C_4JProfile::PROFILESETTINGS *)param,i); + SetDefaultOptions((C_4JProfile::PROFILESETTINGS *)param,i); #endif // if the profile data has been changed, then force a profile write @@ -3663,7 +3663,7 @@ void CMinecraftApp::HandleXuiActions(void) CheckGameSettingsChanged(true,i); break; - + case eAppAction_RemoteServerSave: { // If the remote server save has already finished, don't complete the action @@ -3674,7 +3674,7 @@ void CMinecraftApp::HandleXuiActions(void) } SetAction(i,eAppAction_WaitRemoteServerSaveComplete); - + for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { ui.CloseUIScenes(i, true); @@ -3685,7 +3685,7 @@ void CMinecraftApp::HandleXuiActions(void) LoadingInputParams *loadingParams = new LoadingInputParams(); loadingParams->func = &CMinecraftApp::RemoteSaveThreadProc; - loadingParams->lpParam = NULL; + loadingParams->lpParam = NULL; UIFullscreenProgressCompletionData *completionData = new UIFullscreenProgressCompletionData(); completionData->bRequiresUserAction=FALSE; @@ -3727,7 +3727,7 @@ void CMinecraftApp::HandleXuiActions(void) if(!app.GetGameStarted()) MinecraftServer::HaltServer(true); if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(i,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -3736,7 +3736,7 @@ void CMinecraftApp::HandleXuiActions(void) MinecraftServer::resetFlags(); } break; - + case eAppAction_BanLevel: { // It's possible that this state can get set after the game has been exited (e.g. by network disconnection) so we can't ban the level at that point @@ -3744,12 +3744,12 @@ void CMinecraftApp::HandleXuiActions(void) { TelemetryManager->RecordBanLevel(i); -#if defined _XBOX - INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); +#if defined _XBOX + INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); // write the level to the banned level list, and exit the world AddLevelToBannedLevelList(i,((NetworkPlayerXbox *)pHost)->GetUID(),GetUniqueMapName(),true); #elif defined _XBOX_ONE - INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); + INetworkPlayer *pHost=g_NetworkManager.GetHostPlayer(); AddLevelToBannedLevelList(i,pHost->GetUID(),GetUniqueMapName(),true); #endif // primary player would exit the world, secondary would exit the player @@ -3765,7 +3765,7 @@ void CMinecraftApp::HandleXuiActions(void) } break; case eAppAction_LevelInBanLevelList: - { + { UINT uiIDA[2]; uiIDA[0]=IDS_BUTTON_REMOVE_FROM_BAN_LIST; uiIDA[1]=IDS_EXIT_GAME; @@ -3804,15 +3804,15 @@ void CMinecraftApp::HandleXuiActions(void) break; case eAppAction_ReloadTexturePack: - { + { SetAction(i,eAppAction_Idle); Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->textures->reloadAll(); pMinecraft->skins->updateUI(); - + if(!pMinecraft->skins->isUsingDefaultSkin()) { - TexturePack *pTexturePack = pMinecraft->skins->getSelected(); + TexturePack *pTexturePack = pMinecraft->skins->getSelected(); DLCPack *pDLCPack=pTexturePack->getDLCPack(); @@ -3830,7 +3830,7 @@ void CMinecraftApp::HandleXuiActions(void) // 4J-PB - If the texture pack has audio, we need to switch to this if(pMinecraft->skins->getSelected()->hasAudio()) { - Minecraft::GetInstance()->soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); + Minecraft::GetInstance()->soundEngine->playStreaming(L"", 0, 0, 0, 1, 1); } } @@ -3863,7 +3863,7 @@ void CMinecraftApp::HandleXuiActions(void) eTMS = app.GetTMSAction(i); if(eTMS!=eTMSAction_Idle) - { + { switch(eTMS) { // TMS++ actions @@ -3888,7 +3888,7 @@ void CMinecraftApp::HandleXuiActions(void) #endif case eTMSAction_TMSPP_UserFileList: // retrieve the file list first -#if defined _XBOX +#if defined _XBOX SetTMSAction(i,eTMSAction_TMSPP_UserFileList_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_TitleUser,"\\",eTMSAction_TMSPP_XUIDSFile); #elif defined _XBOX_ONE @@ -3907,7 +3907,7 @@ void CMinecraftApp::HandleXuiActions(void) SetTMSAction(i,eTMSAction_TMSPP_DLCFile); #endif - break; + break; case eTMSAction_TMSPP_DLCFile: #if defined _XBOX || defined _XBOX_ONE SetTMSAction(i,eTMSAction_TMSPP_DLCFile_Waiting); @@ -3941,7 +3941,7 @@ void CMinecraftApp::HandleXuiActions(void) case eTMSAction_TMSPP_RetrieveFiles_HelpAndOptions: case eTMSAction_TMSPP_RetrieveFiles_DLCMain: // retrieve the file list first -#if defined _XBOX +#if defined _XBOX // pass in the next app action on the call or callback completing SetTMSAction(i,eTMSAction_TMSPP_XUIDSFile_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_Title,"\\",eTMSAction_TMSPP_DLCFileOnly); @@ -3953,7 +3953,7 @@ void CMinecraftApp::HandleXuiActions(void) #endif break; case eTMSAction_TMSPP_RetrieveUserFilelist_DLCFileOnly: -#if defined _XBOX +#if defined _XBOX SetTMSAction(i,eTMSAction_TMSPP_UserFileList_Waiting); app.TMSPP_RetrieveFileList(i,C4JStorage::eGlobalStorage_TitleUser,"\\",eTMSAction_TMSPP_XUIDSFile); #elif defined _XBOX_ONE @@ -4095,7 +4095,7 @@ void CMinecraftApp::loadMediaArchive() mediapath = L"Common\\Media\\MediaPSVita.arc"; #endif - if (!mediapath.empty()) + if (!mediapath.empty()) { m_mediaArchive = new ArchiveFile( File(mediapath) ); } @@ -4176,7 +4176,7 @@ int CMinecraftApp::PrimaryPlayerSignedOutReturned(void *pParam,int iPad,const C4 // We always create a session before kicking of any of the game code, so even though we may still be joining/creating a game // at this point we want to handle it differently from just being in a menu if( g_NetworkManager.IsInSession() ) - { + { app.SetAction(iPad,eAppAction_PrimaryPlayerSignedOutReturned); } else @@ -4193,7 +4193,7 @@ int CMinecraftApp::EthernetDisconnectReturned(void *pParam,int iPad,const C4JSto // if the player is null, we're in the menus if(Minecraft::GetInstance()->player!=NULL) - { + { app.SetAction(pMinecraft->player->GetXboxPad(),eAppAction_EthernetDisconnectedReturned); } else @@ -4323,10 +4323,10 @@ int CMinecraftApp::SignoutExitWorldThreadProc( void* lpParameter ) // 4J-JEV: Fix for #106402 - TCR #014 BAS Debug Output: // TU12: Mass Effect Mash-UP: Save file "Default_DisplayName" is created on all storage devices after signing out from a re-launched pre-generated world - app.m_gameRules.unloadCurrentGameRules(); // + app.m_gameRules.unloadCurrentGameRules(); // MinecraftServer::resetFlags(); - + // We can't start/join a new game until the session is destroyed, so wait for it to be idle again while( g_NetworkManager.IsInSession() ) { @@ -4426,7 +4426,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes } #elif defined(__ORBIS__) else - { + { // Determine why they're not "signed in live" if (ProfileManager.isSignedInPSN(iPad)) { @@ -4438,7 +4438,7 @@ int CMinecraftApp::UnlockFullSaveReturned(void *pParam,int iPad,C4JStorage::EMes ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -4495,7 +4495,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes } #elif defined(__ORBIS__) else - { + { // Determine why they're not "signed in live" if (ProfileManager.isSignedInPSN(iPad)) { @@ -4509,7 +4509,7 @@ int CMinecraftApp::UnlockFullExitReturned(void *pParam,int iPad,C4JStorage::EMes pApp->SetAction(pMinecraft->player->GetXboxPad(),eAppAction_ExitWorldTrial); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -4594,7 +4594,7 @@ void CMinecraftApp::ProfileReadErrorCallback(void *pParam) void CMinecraftApp::ClearSignInChangeUsersMask() { - // 4J-PB - When in the main menu, the user is on pad 0, and any change they make to their profile will be to pad 0 data + // 4J-PB - When in the main menu, the user is on pad 0, and any change they make to their profile will be to pad 0 data // If they then go in as a secondary player to a splitscreen game, their profile will not be read again on pad 1 if they were previously in a splitscreen game // This is because m_uiLastSignInData remembers they were in previously, and doesn't read the profile data for them again // Fix this by resetting the m_uiLastSignInData on pressing play game for secondary users. The Primary user does a read profile on play game anyway @@ -4629,7 +4629,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange { // Primary Player gone or there's been a sign out and sign in of the primary player, so kick them out pApp->SetAction(iPrimaryPlayer,eAppAction_PrimaryPlayerSignedOut); - + // 4J-PB - invalidate their banned level list pApp->InvalidateBannedList(iPrimaryPlayer); @@ -4700,7 +4700,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange bool bPlayerChanged=(uiChangedPlayers&(1<m_currentSigninInfo[i].xuid, info.xuid) ) )) + if( bPlayerChanged && (!bPlayerSignedIn || (bPlayerSignedIn && !ProfileManager.AreXUIDSEqual(pApp->m_currentSigninInfo[i].xuid, info.xuid) ) )) { // 4J-PB - invalidate their banned level list pApp->DebugPrintf("Player at index %d Left - invalidating their banned list\n",i); @@ -4735,7 +4735,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange pApp->SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected); } - + g_NetworkManager.HandleSignInChange(); } // Some menus require the player to be signed in to live, so if this callback happens and the primary player is @@ -4749,7 +4749,7 @@ void CMinecraftApp::SignInChangeCallback(LPVOID pParam,bool bPrimaryPlayerChange // 4J-JEV: Need to kick of loading of profile data for sub-sign in players. for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { - if( i != iPrimaryPlayer + if( i != iPrimaryPlayer && ( uiChangedPlayers & (1<RecordUpsellResponded(ProfileManager.GetPrimaryPad(), eSen_UpsellID_Full_Version_Of_Game, app.m_dwOfferID, senResponse); } @@ -4977,7 +4977,7 @@ int CMinecraftApp::DebugInputCallback(LPVOID pParam) { if(app.DebugSettingsOn()) { - app.ActionDebugMask(i); + app.ActionDebugMask(i); } else { @@ -5069,7 +5069,7 @@ void CMinecraftApp::MountNextDLC(int iPad) if(StorageManager.MountInstalledDLC(iPad,m_iTotalDLCInstalled,&CMinecraftApp::DLCMountedCallback,this)!=ERROR_IO_PENDING ) { // corrupt DLC - app.DebugPrintf("Failed to mount DLC %d for pad %d\n",m_iTotalDLCInstalled,iPad); + app.DebugPrintf("Failed to mount DLC %d for pad %d\n",m_iTotalDLCInstalled,iPad); ++m_iTotalDLCInstalled; app.MountNextDLC(iPad); } @@ -5142,7 +5142,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d app.m_dlcManager.removePack(pack); pack = NULL; } - + if(pack == NULL) { app.DebugPrintf("Pack \"%ls\" is not installed, so adding it\n", CONTENT_DATA_DISPLAY_NAME(ContentData)); @@ -5187,15 +5187,15 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // void CMinecraftApp::InstallDefaultCape() // { // if(!m_bDefaultCapeInstallAttempted) -// { +// { // // we only attempt to install the cape once per launch of the game // m_bDefaultCapeInstallAttempted=true; -// +// // wstring wTemp=L"Default_Cape.png"; // bool bRes=app.IsFileInMemoryTextures(wTemp); // // if the file is not already in the memory textures, then read it from TMS // if(!bRes) -// { +// { // BYTE *pBuffer=NULL; // DWORD dwSize=0; // // 4J-PB - out for now for DaveK so he doesn't get the birthday cape @@ -5205,13 +5205,13 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // if(eTMSStatus==C4JStorage::ETMSStatus_Idle) // { // app.AddMemoryTextureFile(wTemp,pBuffer,dwSize); -// } +// } // #endif // } // } // } - void CMinecraftApp::HandleDLC(DLCPack *pack) + void CMinecraftApp::HandleDLC(DLCPack *pack) { DWORD dwFilesProcessed = 0; #ifndef _XBOX @@ -5248,7 +5248,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d { strcpy(szFullFilename,szPath); strcat(szFullFilename,wfd.cFileName); - + if(( GetFileAttributes( szFullFilename ) & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) { #ifdef _XBOX @@ -5259,9 +5259,9 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d File texturePCKPath(wsTemp ); if(texturePCKPath.exists()) { - app.DebugPrintf("Found a replacement .pck\n"); + app.DebugPrintf("Found a replacement .pck\n"); m_dlcManager.readDLCDataFile(dwFilesProcessed, wsTemp,pack); - } + } else { m_dlcManager.readDLCDataFile(dwFilesProcessed, szFullFilename,pack); @@ -5271,7 +5271,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d #endif } - } + } while( FindNextFile( hFind, &wfd ) ); // Close the find handle. @@ -5284,8 +5284,8 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // int CMinecraftApp::DLCReadCallback(LPVOID pParam,C4JStorage::DLC_FILE_DETAILS *pDLCData) // { -// -// +// +// // return 0; // } @@ -5294,7 +5294,7 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // Desc: Initializes the timer variables //------------------------------------------------------------------------------------- void CMinecraftApp::InitTime() - { + { // Get the frequency of the timer LARGE_INTEGER qwTicksPerSec; @@ -5306,8 +5306,8 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d // Zero out the elapsed and total time m_Time.qwAppTime.QuadPart = 0; - m_Time.fAppTime = 0.0f; - m_Time.fElapsedTime = 0.0f; + m_Time.fAppTime = 0.0f; + m_Time.fElapsedTime = 0.0f; } //------------------------------------------------------------------------------------- @@ -5319,14 +5319,14 @@ int CMinecraftApp::DLCMountedCallback(LPVOID pParam,int iPad,DWORD dwErr,DWORD d LARGE_INTEGER qwNewTime; LARGE_INTEGER qwDeltaTime; - QueryPerformanceCounter( &qwNewTime ); + QueryPerformanceCounter( &qwNewTime ); qwDeltaTime.QuadPart = qwNewTime.QuadPart - m_Time.qwTime.QuadPart; - m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart; + m_Time.qwAppTime.QuadPart += qwDeltaTime.QuadPart; m_Time.qwTime.QuadPart = qwNewTime.QuadPart; m_Time.fElapsedTime = m_Time.fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart)); - m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart)); + m_Time.fAppTime = m_Time.fSecsPerTick * ((FLOAT)(m_Time.qwAppTime.QuadPart)); } @@ -5359,8 +5359,8 @@ bool CMinecraftApp::isXuidDeadmau5(PlayerUID xuid) return false; } -void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) -{ +void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD dwBytes) +{ EnterCriticalSection(&csMemFilesLock); // check it's not already in PMEMDATA pData=NULL; @@ -5408,7 +5408,7 @@ void CMinecraftApp::AddMemoryTextureFile(const wstring &wName,PBYTE pbData,DWORD void CMinecraftApp::RemoveMemoryTextureFile(const wstring &wName) { EnterCriticalSection(&csMemFilesLock); - + AUTO_VAR(it, m_MEM_Files.find(wName)); if(it != m_MEM_Files.end()) { @@ -5436,7 +5436,7 @@ bool CMinecraftApp::DefaultCapeExists() EnterCriticalSection(&csMemFilesLock); AUTO_VAR(it, m_MEM_Files.find(wTex)); - if(it != m_MEM_Files.end()) val = true; + if(it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); return val; @@ -5448,7 +5448,7 @@ bool CMinecraftApp::IsFileInMemoryTextures(const wstring &wName) EnterCriticalSection(&csMemFilesLock); AUTO_VAR(it, m_MEM_Files.find(wName)); - if(it != m_MEM_Files.end()) val = true; + if(it != m_MEM_Files.end()) val = true; LeaveCriticalSection(&csMemFilesLock); return val; @@ -5467,14 +5467,14 @@ void CMinecraftApp::GetMemFileDetails(const wstring &wName,PBYTE *ppbData,DWORD LeaveCriticalSection(&csMemFilesLock); } -void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) -{ +void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) +{ EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData=NULL; AUTO_VAR(it, m_MEM_TPD.find(iConfig)); if(it == m_MEM_TPD.end()) - { + { pData = (PMEMDATA)new BYTE[sizeof(MEMDATA)]; ZeroMemory( pData, sizeof(MEMDATA) ); pData->pbData=pbData; @@ -5487,8 +5487,8 @@ void CMinecraftApp::AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes) LeaveCriticalSection(&csMemTPDLock); } -void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) -{ +void CMinecraftApp::RemoveMemoryTPDFile(int iConfig) +{ EnterCriticalSection(&csMemTPDLock); // check it's not already in PMEMDATA pData=NULL; @@ -5550,7 +5550,7 @@ bool CMinecraftApp::IsFileInTPD(int iConfig) EnterCriticalSection(&csMemTPDLock); AUTO_VAR(it, m_MEM_TPD.find(iConfig)); - if(it != m_MEM_TPD.end()) val = true; + if(it != m_MEM_TPD.end()) val = true; LeaveCriticalSection(&csMemTPDLock); return val; @@ -5576,18 +5576,18 @@ void CMinecraftApp::GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes) // #ifndef _CONTENT_PACKAGE // // read the local file // File gtsFile( wsFile->c_str() ); -// -// int64_t fileSize = gtsFile.length(); -// +// +// __int64 fileSize = gtsFile.length(); +// // if(fileSize!=0) // { // FileInputStream fis(gtsFile); // byteArray ba((int)fileSize); // fis.read(ba); // fis.close(); -// +// // bRes=StorageManager.WriteTMSFile(iQuadrant,eStorageFacility,(WCHAR *)wsFile->c_str(),ba.data, ba.length); -// +// // } // #endif // return bRes; @@ -5637,7 +5637,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad CMinecraftApp *pClass = (CMinecraftApp *)pParam; // Exit with or without saving // Decline means save in this dialog - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) { if( result==C4JStorage::EMessage_ResultDecline ) // Save { @@ -5649,7 +5649,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad DLCPack * pDLCPack=tPack->getDLCPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { // upsell // get the dlc texture pack @@ -5669,7 +5669,7 @@ int CMinecraftApp::ExitAndJoinFromInviteSaveDialogReturned(void *pParam,int iPad // Give the player a warning about the trial version of the texture pack ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, iPad,&CMinecraftApp::WarningTrialTexturePackReturned,pClass,app.GetStringTable()); - return S_OK; + return S_OK; } } #ifndef _XBOX_ONE @@ -5727,7 +5727,7 @@ int CMinecraftApp::WarningTrialTexturePackReturned(void *pParam,int iPad,C4JStor if(result==C4JStorage::EMessage_ResultAccept) { if(ProfileManager.IsSignedIn(iPad)) - { + { // need to allow downloads here, or the player would need to quit the game to let the download of a texture pack happen. This might affect the network traffic, since the download could take all the bandwidth... XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -5747,7 +5747,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 //CMinecraftApp* pClass = (CMinecraftApp*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { INT saveOrCheckpointId = 0; @@ -5759,7 +5759,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 DLCPack * pDLCPack=tPack->getDLCPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { // upsell // get the dlc texture pack @@ -5779,7 +5779,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 // Give the player a warning about the trial version of the texture pack ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_WARNING_DLC_TRIALTEXTUREPACK_TEXT, uiIDA, 2, iPad,&CMinecraftApp::WarningTrialTexturePackReturned,NULL,app.GetStringTable()); - return S_OK; + return S_OK; } } //bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); @@ -5794,7 +5794,7 @@ int CMinecraftApp::ExitAndJoinFromInviteAndSaveReturned(void *pParam,int iPad,C4 int CMinecraftApp::ExitAndJoinFromInviteDeclineSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { #if defined(_XBOX_ONE) || defined(__ORBIS__) StorageManager.SetSaveDisabled(false); @@ -5921,7 +5921,7 @@ void CMinecraftApp::InitialiseTips() // Only randomise the content package build #ifdef _CONTENT_PACKAGE - + for(int i=1;inextInt(); @@ -5983,7 +5983,7 @@ UINT CMinecraftApp::GetNextTip() } else { - if(bShowSkinDLCTip && ProfileManager.IsFullVersion()) + if(bShowSkinDLCTip && ProfileManager.IsFullVersion()) { bShowSkinDLCTip=false; if( app.DLCInstallProcessCompleted() ) @@ -6019,7 +6019,7 @@ int CMinecraftApp::GetHTMLFontSize(EHTMLFontSize size) wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shadowColour /*= 0xFFFFFFFF*/) { wstring text(desc); - + wchar_t replacements[64]; // We will also insert line breaks here as couldn't figure out how to get them to come through from strings.resx ! text = replaceAll(text, L"{*B*}", L"
" ); @@ -6108,7 +6108,7 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado text = replaceAll(text, L"{*ICON_SHANK_03*}", GetIconReplacement(XZP_ICON_SHANK_03) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_UP*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_UP ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_DOWN*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_DOWN ) ); - text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) ); + text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_RIGHT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_RIGHT ) ); text = replaceAll(text, L"{*CONTROLLER_ACTION_DPAD_LEFT*}", GetActionReplacement(iPad,MINECRAFT_ACTION_DPAD_LEFT ) ); #if defined _XBOX_ONE || defined __PSVITA__ text = replaceAll(text, L"{*CONTROLLER_VK_START*}", GetVKReplacement(VK_PAD_START ) ); @@ -6124,13 +6124,13 @@ wstring CMinecraftApp::FormatHTMLString(int iPad, const wstring &desc, int shado text = replaceAll(text, L"{*IMAGEROOT*}", imageRoot); #endif // _XBOX - // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good + // Fix for #8903 - UI: Localization: KOR/JPN/CHT: Button Icons are rendered with padding space, which looks no good DWORD dwLanguage = XGetLanguage( ); switch(dwLanguage) { - case XC_LANGUAGE_KOREAN: + case XC_LANGUAGE_KOREAN: case XC_LANGUAGE_JAPANESE: - case XC_LANGUAGE_TCHINESE: + case XC_LANGUAGE_TCHINESE: text = replaceAll(text, L" ", L"" ); break; } @@ -6273,7 +6273,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey) case VK_PAD_LTHUMB_UPLEFT : case VK_PAD_LTHUMB_UPRIGHT : case VK_PAD_LTHUMB_DOWNRIGHT: - case VK_PAD_LTHUMB_DOWNLEFT : + case VK_PAD_LTHUMB_DOWNLEFT : return app.GetString( IDS_CONTROLLER_LEFT_STICK ); case VK_PAD_RTHUMB_UP : case VK_PAD_RTHUMB_DOWN : @@ -6282,7 +6282,7 @@ wstring CMinecraftApp::GetVKReplacement(unsigned int uiVKey) case VK_PAD_RTHUMB_UPLEFT : case VK_PAD_RTHUMB_UPRIGHT : case VK_PAD_RTHUMB_DOWNRIGHT: - case VK_PAD_RTHUMB_DOWNLEFT : + case VK_PAD_RTHUMB_DOWNLEFT : return app.GetString( IDS_CONTROLLER_RIGHT_STICK ); default: break; @@ -6445,7 +6445,7 @@ HRESULT CMinecraftApp::RegisterMojangData(WCHAR *pXuidName, PlayerUID xuid, WCHA // ignore the names if we don't recognize them if(pXuidName!=NULL) - { + { if( wcscmp( pXuidName, L"XUID_NOTCH" ) == 0 ) { eTempXuid = eXUID_Notch; // might be needed for the apple at some point @@ -6465,7 +6465,7 @@ HRESULT CMinecraftApp::RegisterMojangData(WCHAR *pXuidName, PlayerUID xuid, WCHA pMojangData = new MOJANG_DATA; ZeroMemory(pMojangData,sizeof(MOJANG_DATA)); pMojangData->eXuid=eTempXuid; - + wcsncpy( pMojangData->wchSkin, pSkin, MAX_CAPENAME_SIZE); wcsncpy( pMojangData->wchCape, pCape, MAX_CAPENAME_SIZE); MojangData[xuid]=pMojangData; @@ -6485,7 +6485,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) // #ifdef _XBOX // if(pType!=NULL) -// { +// { // if(wcscmp(pType,L"XboxOneTransfer")==0) // { // if(iValue>0) @@ -6501,7 +6501,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) // { // app.m_uiTransferSlotC=iValue; // } -// +// // } // #endif @@ -6510,7 +6510,7 @@ HRESULT CMinecraftApp::RegisterConfigValues(WCHAR *pType, int iValue) } #if (defined _XBOX || defined _WINDOWS64) -HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, uint64_t ullOfferID_Full, uint64_t ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) +HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGender, __uint64 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) { HRESULT hr=S_OK; DLC_INFO *pDLCData=new DLC_INFO; @@ -6525,18 +6525,18 @@ HRESULT CMinecraftApp::RegisterDLCData(WCHAR *pType, WCHAR *pBannerName, int iGe #ifndef __ORBIS__ // ignore the names if we don't recognize them if(pBannerName!=L"") - { + { wcsncpy_s( pDLCData->wchBanner, pBannerName, MAX_BANNERNAME_SIZE); } if(pDataFile[0]!=0) - { + { wcsncpy_s( pDLCData->wchDataFile, pDataFile, MAX_BANNERNAME_SIZE); } #endif if(pType!=NULL) - { + { if(wcscmp(pType,L"Skin")==0) { pDLCData->eDLCType=e_DLC_SkinPack; @@ -6615,12 +6615,12 @@ HRESULT CMinecraftApp::RegisterDLCData(eDLCContentType eType, WCHAR *pwchBannerN // ignore the names if we don't recognize them if(pwchBannerName!=L"") - { + { wcsncpy_s( pDLCData->wchBanner, pwchBannerName, MAX_BANNERNAME_SIZE); } if(pwchProductName[0]!=0) - { + { pDLCData->wsDisplayName=pwchProductName; } @@ -6662,7 +6662,7 @@ HRESULT CMinecraftApp::RegisterDLCData(char *pchDLCName, unsigned int uiSortInde pDLCData->iConfig = app.GetiConfigFromName(pchDLCName); pDLCData->uiSortIndex=uiSortIndex; - pDLCData->eDLCType = app.GetDLCTypeFromName(pchDLCName); + pDLCData->eDLCType = app.GetDLCTypeFromName(pchDLCName); strcpy(pDLCData->chImageURL,pchImageURL); //bool bIsTrialDLC = app.GetTrialFromName(pchDLCName); @@ -6734,7 +6734,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfo(char *pchDLCName) string tempString=pchDLCName; if(DLCInfo.size()>0) - { + { AUTO_VAR(it, DLCInfo.find(tempString)); if( it == DLCInfo.end() ) @@ -6807,7 +6807,7 @@ bool CMinecraftApp::GetDLCFullOfferIDForPackID(const int iPackID,wstring &Produc { AUTO_VAR(it, DLCTextures_PackID.find(iPackID)); if( it == DLCTextures_PackID.end() ) - { + { return false; } else @@ -6879,7 +6879,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial) { //DLC_INFO *pDLCInfo=NULL; if(DLCInfo_Trial.size()>0) - { + { AUTO_VAR(it, DLCInfo_Trial.find(ullOfferID_Trial)); if( it == DLCInfo_Trial.end() ) @@ -6936,7 +6936,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(WCHAR *pwchProductID) { wstring wsTemp = pwchProductID; if(DLCInfo_Full.size()>0) - { + { AUTO_VAR(it, DLCInfo_Full.find(wsTemp)); if( it == DLCInfo_Full.end() ) @@ -6965,7 +6965,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForProductName(WCHAR *pwchProductName) } ++it; } - + return NULL; } @@ -6976,7 +6976,7 @@ DLC_INFO *CMinecraftApp::GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full) { if(DLCInfo_Full.size()>0) - { + { AUTO_VAR(it, DLCInfo_Full.find(ullOfferID_Full)); if( it == DLCInfo_Full.end() ) @@ -7069,7 +7069,7 @@ int CMinecraftApp::RemoteSaveThreadProc( void* lpParameter ) void CMinecraftApp::ExitGameFromRemoteSave( LPVOID lpParameter ) { int primaryPad = ProfileManager.GetPrimaryPad(); - + UINT uiIDA[3]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; @@ -7082,11 +7082,11 @@ int CMinecraftApp::ExitGameFromRemoteSaveDialogReturned(void *pParam,int iPad,C4 //CScene_Pause* pClass = (CScene_Pause*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { app.SetAction(iPad,eAppAction_ExitWorld); } - else + else { #ifndef _XBOX // Inform fullscreen progress scene that it's not being cancelled after all @@ -7167,7 +7167,7 @@ void CMinecraftApp::AddLevelToBannedLevelList(int iPad, PlayerUID xuid, char *ps m_vBannedListA[iPad]->push_back(pBannedListData); if(bWriteToTMS) - { + { DWORD dwDataBytes=(DWORD)(sizeof(BANNEDLISTDATA)*m_vBannedListA[iPad]->size()); PBANNEDLISTDATA pBannedList = (BANNEDLISTDATA *)(new CHAR [dwDataBytes]); int iCount=0; @@ -7197,7 +7197,7 @@ bool CMinecraftApp::IsInBannedLevelList(int iPad, PlayerUID xuid, char *pszLevel #ifdef _XBOX_ONE PlayerUID bannedPlayerUID = pData->wchPlayerUID; if(IsEqualXUID (bannedPlayerUID,xuid) && (strcmp(pData->pszLevelName,pszLevelName)==0)) -#else +#else if(IsEqualXUID (pData->xuid,xuid) && (strcmp(pData->pszLevelName,pszLevelName)==0)) #endif { @@ -7212,12 +7212,12 @@ void CMinecraftApp::RemoveLevelFromBannedLevelList(int iPad, PlayerUID xuid, cha { //bool bFound=false; //bool bRes; - + // we will have retrieved the banned level list from TMS, so remove this one from it and write it back to TMS for(AUTO_VAR(it, m_vBannedListA[iPad]->begin()); it != m_vBannedListA[iPad]->end(); ) { PBANNEDLISTDATA pBannedListData = *it; - + if(pBannedListData!=NULL) { #ifdef _XBOX_ONE @@ -7298,7 +7298,7 @@ bool CMinecraftApp::AlreadySeenCreditText(const wstring &wstemp) wstring temp=m_vCreditText.at(i); // if they are the same, break out of the case - if(temp.compare(wstemp)==0) + if(temp.compare(wstemp)==0) { return true; } @@ -7588,7 +7588,7 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame break; case eGameHostOption_FireSpreads: return (uiHostSettings&GAME_HOST_OPTION_BITMASK_FIRESPREADS); - break; + break; case eGameHostOption_CheatsEnabled: return (uiHostSettings&(GAME_HOST_OPTION_BITMASK_HOSTFLY|GAME_HOST_OPTION_BITMASK_HOSTHUNGER|GAME_HOST_OPTION_BITMASK_HOSTINVISIBLE)); break; @@ -7606,7 +7606,7 @@ unsigned int CMinecraftApp::GetGameHostOption(unsigned int uiHostSettings, eGame break; case eGameHostOption_DisableSaving: return (uiHostSettings&GAME_HOST_OPTION_BITMASK_DISABLESAVE); - break; + break; } return false; @@ -7659,7 +7659,7 @@ unsigned int CMinecraftApp::FromBigEndian(unsigned int uiValue) // Keep it in big endian return uiValue; #else - unsigned int uiReturn = ( ( uiValue >> 24 ) & 0x000000ff ) | + unsigned int uiReturn = ( ( uiValue >> 24 ) & 0x000000ff ) | ( ( uiValue >> 8 ) & 0x0000ff00 ) | ( ( uiValue << 8 ) & 0x00ff0000 ) | ( ( uiValue << 24 ) & 0xff000000 ); @@ -7685,7 +7685,7 @@ void CMinecraftApp::GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsig uiCount+=8; while(uiCounteTerrainFeature==eType) { *pX=pFeatureData->x; *pZ=pFeatureData->z; return true; - } + } } return false; @@ -7976,7 +7976,7 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType, bool bPromo { // promote if(bPromote) - { + { m_DLCDownloadQueue.erase(m_DLCDownloadQueue.begin()+iPosition); m_DLCDownloadQueue.insert(m_DLCDownloadQueue.begin(),pCurrent); } @@ -7988,10 +7988,10 @@ unsigned int CMinecraftApp::AddDLCRequest(eDLCMarketplaceType eType, bool bPromo } DLCRequest *pDLCreq = new DLCRequest; - pDLCreq->dwType=m_dwContentTypeA[eType]; + pDLCreq->dwType=m_dwContentTypeA[eType]; pDLCreq->eState=e_DLC_ContentState_Idle; - m_DLCDownloadQueue.push_back(pDLCreq); + m_DLCDownloadQueue.push_back(pDLCreq); m_bAllDLCContentRetrieved=false; LeaveCriticalSection(&csDLCDownloadQueue); @@ -8023,7 +8023,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool { // promote if(bPromote) - { + { m_TMSPPDownloadQueue.erase(m_TMSPPDownloadQueue.begin()+iPosition); m_TMSPPDownloadQueue.insert(m_TMSPPDownloadQueue.begin(),pCurrent); bPromoted=true; @@ -8057,17 +8057,17 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool { // first check if the image is already in the memory textures, since we might be loading some from the Title Update partition if(pDLC->wchDataFile[0]!=0) - { + { //WCHAR *cString = pDLC->wchDataFile; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first //int iIndex = app.GetLocalTMSFileIndex(pDLC->wchDataFile,true); //if(iIndex!=-1) - { + { bool bPresent = app.IsFileInTPD(pDLC->iConfig); if(!bPresent) - { + { // this may already be present in the vector because of a previous trial/full offer bool bAlreadyInQueue=false; @@ -8083,7 +8083,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { TMSPPRequest *pTMSPPreq = new TMSPPRequest; pTMSPPreq->CallbackFunc=&CMinecraftApp::TMSPPFileReturned; @@ -8095,7 +8095,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; m_TMSPPDownloadQueue.push_back(pTMSPPreq); - } + } } else { @@ -8119,20 +8119,20 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool // is this the right type? if(pDLC->eDLCType==eType) - { + { WCHAR *cString = pDLC->wchBanner; // 4J-PB - shouldn't check this here - let the TMS files override it, so if they are on TMS, we'll take them first - // is the file in the TMS XZP? + // is the file in the TMS XZP? //int iIndex = app.GetLocalTMSFileIndex(cString,true); //if(iIndex!=-1) - { - bool bPresent = app.IsFileInMemoryTextures(cString); + { + bool bPresent = app.IsFileInMemoryTextures(cString); if(!bPresent) // retrieve it from TMSPP - { + { bool bAlreadyInQueue=false; for(AUTO_VAR(it, m_TMSPPDownloadQueue.begin()); it != m_TMSPPDownloadQueue.end(); ++it) { @@ -8146,7 +8146,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { TMSPPRequest *pTMSPPreq = new TMSPPRequest; pTMSPPreq->CallbackFunc=&CMinecraftApp::TMSPPFileReturned; @@ -8159,7 +8159,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool pTMSPPreq->eState=e_TMS_ContentState_Queued; m_bAllTMSContentRetrieved=false; - m_TMSPPDownloadQueue.push_back(pTMSPPreq); + m_TMSPPDownloadQueue.push_back(pTMSPPreq); app.DebugPrintf("===m_TMSPPDownloadQueue Adding %ls, q size is %d\n",pTMSPPreq->wchFilename,m_TMSPPDownloadQueue.size()); } } @@ -8183,11 +8183,11 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool //int iIndex = app.GetLocalTMSFileIndex(cString,true); //if(iIndex!=-1) - { + { bool bPresent = app.IsFileInMemoryTextures(cString); - + if(!bPresent) - { + { // this may already be present in the vector because of a previous trial/full offer bool bAlreadyInQueue=false; @@ -8203,7 +8203,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool } if(!bAlreadyInQueue) - { + { //app.DebugPrintf("Adding a request to the TMSPP download queue - %ls\n",pDLC->wchBanner); TMSPPRequest *pTMSPPreq = new TMSPPRequest; ZeroMemory(pTMSPPreq,sizeof(TMSPPRequest)); @@ -8222,7 +8222,7 @@ unsigned int CMinecraftApp::AddTMSPPFileTypeRequest(eDLCContentType eType, bool m_bAllTMSContentRetrieved=false; m_TMSPPDownloadQueue.push_back(pTMSPPreq); app.DebugPrintf("===m_TMSPPDownloadQueue Adding %ls, q size is %d\n",pTMSPPreq->wchFilename,m_TMSPPDownloadQueue.size()); - } + } } } } @@ -8329,7 +8329,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto #if defined(_XBOX) || defined(_WINDOWS64) char szFile[MAX_TMSFILENAME_SIZE]; wcstombs(szFile,pCurrent->wchFilename,MAX_TMSFILENAME_SIZE); - + if(strcmp(szFilename,szFile)==0) #elif _XBOX_ONE @@ -8340,15 +8340,15 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto pCurrent->eState=e_TMS_ContentState_Retrieved; if(pFileData!=NULL) - { + { #ifdef _XBOX_ONE - + switch(pCurrent->eType) { case e_DLC_TexturePackData: - { + { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory PBYTE pbData = new BYTE [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); @@ -8357,17 +8357,17 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto app.DebugPrintf("Got texturepack data\n"); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pbData, pFileData->dwSize); } break; default: // 4J-PB - check the data is an image if(pFileData->pbData[0]==0x89) - { + { // 4J-PB - we need to allocate memory for the file data and copy into it, since the current data is a reference into the blob download memory PBYTE pbData = new BYTE [pFileData->dwSize]; memcpy(pbData,pFileData->pbData,pFileData->dwSize); - + pClass->m_vTMSPPData.push_back(pbData); app.DebugPrintf("Got image data - %ls\n",pCurrent->wchFilename); app.AddMemoryTextureFile(pCurrent->wchFilename, pbData, pFileData->dwSize); @@ -8383,11 +8383,11 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto switch(pCurrent->eType) { case e_DLC_TexturePackData: - { + { app.DebugPrintf("--- Got texturepack data %ls\n",pCurrent->wchFilename); // get the config value for the texture pack int iConfig=app.GetTPConfigVal(pCurrent->wchFilename); - app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize); + app.AddMemoryTPDFile(iConfig, pFileData->pbData, pFileData->dwSize); } break; default: @@ -8407,7 +8407,7 @@ int CMinecraftApp::TMSPPFileReturned(LPVOID pParam,int iPad,int iUserData,C4JSto } break; } - + } LeaveCriticalSection(&pClass->csTMSPPDownloadQueue); @@ -8651,7 +8651,7 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D for(unsigned int i=0;iAddOrRetrievePart(&SkinBoxA[i]); pvModelPart->push_back(pModelPart); pvSkinBoxes->push_back(&SkinBoxA[i]); @@ -8661,7 +8661,7 @@ void CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, SKIN_BOX *SkinBoxA, D m_AdditionalModelParts.insert( std::pair *>(dwSkinID, pvModelPart) ); m_AdditionalSkinBoxes.insert( std::pair *>(dwSkinID, pvSkinBoxes) ); - + LeaveCriticalSection( &csAdditionalSkinBoxes ); LeaveCriticalSection( &csAdditionalModelParts ); @@ -8681,7 +8681,7 @@ vector * CMinecraftApp::SetAdditionalSkinBoxes(DWORD dwSkinID, vect for(AUTO_VAR(it, pvSkinBoxA->begin());it != pvSkinBoxA->end(); ++it) { if(pModel) - { + { ModelPart *pModelPart=pModel->AddOrRetrievePart(*it); pvModelPart->push_back(pModelPart); } @@ -8725,7 +8725,7 @@ vector *CMinecraftApp::GetAdditionalSkinBoxes(DWORD dwSkinID) pvSkinBoxes = (*it).second; } } - + LeaveCriticalSection( &csAdditionalSkinBoxes ); return pvSkinBoxes; } @@ -8768,16 +8768,16 @@ void CMinecraftApp::SetAnimOverrideBitmask(DWORD dwSkinID,unsigned int uiAnimOve DWORD CMinecraftApp::getSkinIdFromPath(const wstring &skin) { - bool dlcSkin = false; + bool dlcSkin = false; unsigned int skinId = 0; - + if(skin.size() >= 14) { dlcSkin = skin.substr(0,3).compare(L"dlc") == 0; wstring skinValue = skin.substr(7,skin.size()); skinValue = skinValue.substr(0,skinValue.find_first_of(L'.')); - + std::wstringstream ss; // 4J Stu - dlc skins are numbered using decimal to make it easier for artists/people to number manually // Everything else is numbered using hex @@ -8801,7 +8801,7 @@ wstring CMinecraftApp::getSkinPathFromId(DWORD skinId) { // 4J Stu - DLC skins are numbered using decimal rather than hex to make it easier to number manually swprintf(chars, 256, L"dlcskin%08d.png", GET_DLC_SKIN_ID_FROM_BITMASK(skinId)); - + } else { @@ -8826,7 +8826,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E if(result!=C4JStorage::EMessage_Cancelled) { if(app.GetRequiredTexturePackID()!=0) - { + { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -8844,7 +8844,7 @@ int CMinecraftApp::TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::E DLC_INFO *pDLCInfo=app.GetDLCInfoForFullOfferID(ullOfferID_Full); ullIndexA[0]=pDLCInfo->ullOfferID_Trial; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); - } + } } } #endif @@ -8887,39 +8887,39 @@ byteArray CMinecraftApp::getArchiveFile(const wstring &filename) // DLC #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) -int CMinecraftApp::GetDLCInfoCount() -{ +int CMinecraftApp::GetDLCInfoCount() +{ return (int)DLCInfo.size(); } #elif defined _XBOX_ONE -int CMinecraftApp::GetDLCInfoTrialOffersCount() -{ +int CMinecraftApp::GetDLCInfoTrialOffersCount() +{ return 0; } -int CMinecraftApp::GetDLCInfoFullOffersCount() -{ +int CMinecraftApp::GetDLCInfoFullOffersCount() +{ return (int)DLCInfo_Full.size(); } #else -int CMinecraftApp::GetDLCInfoTrialOffersCount() -{ +int CMinecraftApp::GetDLCInfoTrialOffersCount() +{ return (int)DLCInfo_Trial.size(); } -int CMinecraftApp::GetDLCInfoFullOffersCount() -{ +int CMinecraftApp::GetDLCInfoFullOffersCount() +{ return (int)DLCInfo_Full.size(); } #endif -int CMinecraftApp::GetDLCInfoTexturesOffersCount() -{ +int CMinecraftApp::GetDLCInfoTexturesOffersCount() +{ return (int)DLCTextures_PackID.size(); } // AUTOSAVE -void CMinecraftApp::SetAutosaveTimerTime(void) +void CMinecraftApp::SetAutosaveTimerTime(void) { #if defined(_XBOX_ONE) || defined(__ORBIS__) m_uiAutosaveTimer= GetTickCount()+1000*60; @@ -8928,23 +8928,23 @@ void CMinecraftApp::SetAutosaveTimerTime(void) #endif }// value x 15 to get mins, x60 for secs -bool CMinecraftApp::AutosaveDue(void) -{ +bool CMinecraftApp::AutosaveDue(void) +{ return (GetTickCount()>m_uiAutosaveTimer); } -unsigned int CMinecraftApp::SecondsToAutosave() -{ - return (m_uiAutosaveTimer - GetTickCount() ) / 1000; +unsigned int CMinecraftApp::SecondsToAutosave() +{ + return (m_uiAutosaveTimer - GetTickCount() ) / 1000; } -void CMinecraftApp::SetTrialTimerStart(void) +void CMinecraftApp::SetTrialTimerStart(void) { m_fTrialTimerStart=m_Time.fAppTime; mfTrialPausedTime=0.0f; } -float CMinecraftApp::getTrialTimer(void) -{ +float CMinecraftApp::getTrialTimer(void) +{ return m_Time.fAppTime-m_fTrialTimerStart-mfTrialPausedTime; } @@ -8979,7 +8979,7 @@ bool CMinecraftApp::IsLocalMultiplayerAvailable() //#else // for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) // { - // if( (i!=userIndex) && (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ) + // if( (i!=userIndex) && (InputManager.IsPadConnected(i) || ProfileManager.IsSignedIn(i)) ) // { // iOtherConnectedControllers++; // } @@ -8993,7 +8993,7 @@ bool CMinecraftApp::IsLocalMultiplayerAvailable() void CMinecraftApp::getLocale(vector &vecWstrLocales) { vector locales; - + DWORD dwSystemLanguage = XGetLanguage( ); // 4J-PB - restrict the 360 language until we're ready to have them in @@ -9054,7 +9054,7 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) case XC_LOCALE_UNITED_ARAB_EMIRATES: case XC_LOCALE_GREAT_BRITAIN: locales.push_back(eMCLang_enGB); - break; + break; default: //XC_LOCALE_UNITED_STATES break; } @@ -9151,7 +9151,7 @@ void CMinecraftApp::getLocale(vector &vecWstrLocales) break; case XC_LANGUAGE_BNORWEGIAN : locales.push_back(eMCLang_nbNO); - locales.push_back(eMCLang_noNO); + locales.push_back(eMCLang_noNO); locales.push_back(eMCLang_nnNO); break; case XC_LANGUAGE_DUTCH : @@ -9294,7 +9294,7 @@ void CMinecraftApp::LocaleAndLanguageInit() m_localeA[eMCLang_esCO] =L"es-CO"; m_localeA[eMCLang_esUS] =L"es-US"; m_localeA[eMCLang_svSE] =L"sv-SE"; - + m_localeA[eMCLang_csCZ] =L"cs-CZ"; m_localeA[eMCLang_elGR] =L"el-GR"; m_localeA[eMCLang_nnNO] =L"nn-NO"; diff --git a/Minecraft.Client/Common/Consoles_App.h b/Minecraft.Client/Common/Consoles_App.h index 68f4ccd4..110054f2 100644 --- a/Minecraft.Client/Common/Consoles_App.h +++ b/Minecraft.Client/Common/Consoles_App.h @@ -28,7 +28,7 @@ typedef struct _JoinFromInviteData DWORD dwUserIndex; // dwUserIndex DWORD dwLocalUsersMask; // dwUserMask const INVITE_INFO *pInviteInfo; // pInviteInfo -} +} JoinFromInviteData; class Player; @@ -50,7 +50,7 @@ class Merchant; class CMinecraftAudio; -class CMinecraftApp +class CMinecraftApp #ifdef _XBOX : public CXuiModule @@ -87,7 +87,7 @@ public: #ifdef _EXTENDED_ACHIEVEMENTS /* 4J-JEV: - * We need more space in the profile data because of the new achievements and statistics + * We need more space in the profile data because of the new achievements and statistics * necessary for the new expanded achievement set. */ static const int GAME_DEFINED_PROFILE_DATA_BYTES = 2*972; // per user @@ -108,7 +108,7 @@ public: static const int USER_RR = 5; static const int USER_SR = 6; static const int USER_UI = 7; // 4J Stu - This also makes it appear on the UI console - + void HandleButtonPresses(); bool IntroRunning() { return m_bIntroRunning;} void SetIntroRunning(bool bSet) {m_bIntroRunning=bSet;} @@ -152,14 +152,14 @@ public: void SetGlobalXuiAction(eXuiAction action) {m_eGlobalXuiAction=action;} eXuiAction GetXuiAction(int iPad) {return m_eXuiAction[iPad];} void SetAction(int iPad, eXuiAction action, LPVOID param = NULL); - void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } + void SetTMSAction(int iPad, eTMSAction action) {m_eTMSAction[iPad]=action; } eTMSAction GetTMSAction(int iPad) {return m_eTMSAction[iPad];} eXuiServerAction GetXuiServerAction(int iPad) {return m_eXuiServerAction[iPad];} LPVOID GetXuiServerActionParam(int iPad) {return m_eXuiServerActionParam[iPad];} void SetXuiServerAction(int iPad, eXuiServerAction action, LPVOID param = NULL) {m_eXuiServerAction[iPad]=action; m_eXuiServerActionParam[iPad] = param;} eXuiServerAction GetGlobalXuiServerAction() {return m_eGlobalXuiServerAction;} void SetGlobalXuiServerAction(eXuiServerAction action) {m_eGlobalXuiServerAction=action;} - + DisconnectPacket::eDisconnectReason GetDisconnectReason() { return m_disconnectReason; } void SetDisconnectReason(DisconnectPacket::eDisconnectReason bVal) { m_disconnectReason = bVal; } @@ -224,7 +224,7 @@ public: #endif virtual void SetRichPresenceContext(int iPad, int contextId) = 0; - + void SetGameSettings(int iPad,eGameSetting eVal,unsigned char ucVal); unsigned char GetGameSettings(int iPad,eGameSetting eVal); unsigned char GetGameSettings(eGameSetting eVal); // for the primary pad @@ -268,7 +268,7 @@ public: void SetGameSettingsDebugMask(int iPad, unsigned int uiVal); void ActionDebugMask(int iPad, bool bSetAllClear=false); - // + // bool IsLocalMultiplayerAvailable(); // for sign in change monitoring @@ -343,7 +343,7 @@ public: // Texture Pack Data files (icon, banner, comparison shot & text) void AddMemoryTPDFile(int iConfig,PBYTE pbData,DWORD dwBytes); - void RemoveMemoryTPDFile(int iConfig); + void RemoveMemoryTPDFile(int iConfig); bool IsFileInTPD(int iConfig); void GetTPD(int iConfig,PBYTE *ppbData,DWORD *pdwBytes); int GetTPDSize() {return m_MEM_TPD.size();} @@ -424,11 +424,11 @@ public: byteArray getArchiveFile(const wstring &filename); private: - + static int BannedLevelDialogReturned(void *pParam,int iPad,const C4JStorage::EMessageResult); static int TexturePackDialogReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); - - VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; + + VBANNEDLIST *m_vBannedListA[XUSER_MAX_COUNT]; void HandleButtonPresses(int iPad); @@ -456,7 +456,7 @@ private: static unsigned int m_uiLastSignInData; - // We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings + // We've got sizeof(GAME_SETTINGS) bytes reserved at the start of the gamedefined data per player for settings GAME_SETTINGS *GameSettingsA[XUSER_MAX_COUNT]; // For promo work @@ -489,7 +489,7 @@ public: // trial timer void SetTrialTimerStart(void); float getTrialTimer(void); - + // notifications from the game for qnet VNOTIFICATIONS *GetNotifications() {return &m_vNotifications;} @@ -501,7 +501,7 @@ private: eXuiAction m_eXuiAction[XUSER_MAX_COUNT]; eTMSAction m_eTMSAction[XUSER_MAX_COUNT]; LPVOID m_eXuiActionParam[XUSER_MAX_COUNT]; - eXuiAction m_eGlobalXuiAction; + eXuiAction m_eGlobalXuiAction; eXuiServerAction m_eXuiServerAction[XUSER_MAX_COUNT]; LPVOID m_eXuiServerActionParam[XUSER_MAX_COUNT]; eXuiServerAction m_eGlobalXuiServerAction; @@ -525,20 +525,20 @@ private: // Trial timer float m_fTrialTimerStart,mfTrialPausedTime; typedef struct TimeInfo - { - LARGE_INTEGER qwTime; - LARGE_INTEGER qwAppTime; + { + LARGE_INTEGER qwTime; + LARGE_INTEGER qwAppTime; - float fAppTime; - float fElapsedTime; - float fSecsPerTick; - } TIMEINFO; + float fAppTime; + float fElapsedTime; + float fSecsPerTick; + } TIMEINFO; TimeInfo m_Time; protected: - static const int MAX_TIPS_GAMETIP = 50; - static const int MAX_TIPS_TRIVIATIP = 20; + static const int MAX_TIPS_GAMETIP = 50; + static const int MAX_TIPS_TRIVIATIP = 20; static TIPSTRUCT m_GameTipA[MAX_TIPS_GAMETIP]; static TIPSTRUCT m_TriviaTipA[MAX_TIPS_TRIVIATIP]; static Random *TipRandom; @@ -590,7 +590,7 @@ public: DLC_INFO *GetDLCInfoForFullOfferID(WCHAR *pwchProductId); DLC_INFO *GetDLCInfoForProductName(WCHAR *pwchProductName); #else - static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, uint64_t, uint64_t, WCHAR *, unsigned int, int, WCHAR *pDataFile); + static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, __uint64, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile); bool GetDLCFullOfferIDForSkinID(const wstring &FirstSkin,ULONGLONG *pullVal); DLC_INFO *GetDLCInfoForTrialOfferID(ULONGLONG ullOfferID_Trial); DLC_INFO *GetDLCInfoForFullOfferID(ULONGLONG ullOfferID_Full); @@ -618,7 +618,7 @@ private: #if defined(__PS3__) || defined(__ORBIS__) || defined (__PSVITA__) static unordered_map MojangData; static unordered_map DLCTextures_PackID; // for mash-up packs & texture packs - static unordered_map DLCInfo; + static unordered_map DLCInfo; static unordered_map DLCInfo_SkinName; // skin name, full offer id #elif defined(_DURANGO) static unordered_map MojangData; @@ -701,7 +701,7 @@ public: // World seed from png image void GetImageTextData(PBYTE pbImageData, DWORD dwImageBytes,unsigned char *pszSeed,unsigned int &uiHostOptions,bool &bHostOptionsRead,DWORD &uiTexturePack); - unsigned int CreateImageTextData(PBYTE bTextMetadata, int64_t seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); + unsigned int CreateImageTextData(PBYTE bTextMetadata, __int64 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); // Game rules GameRuleManager m_gameRules; @@ -745,7 +745,7 @@ public: unsigned int AddTMSPPFileTypeRequest(eDLCContentType eType, bool bPromote=false); int GetDLCInfoTexturesOffersCount(); #if defined( __PS3__) || defined(__ORBIS__) || defined(__PSVITA__) - DLC_INFO *GetDLCInfo(int iIndex); + DLC_INFO *GetDLCInfo(int iIndex); DLC_INFO *GetDLCInfo(char *); DLC_INFO *GetDLCInfoFromTPackID(int iTPID); bool GetDLCNameForPackID(const int iPackID,char **ppchKeyID); @@ -887,15 +887,15 @@ public: #ifdef _XBOX // bool m_bTransferSavesToXboxOne; // unsigned int m_uiTransferSlotC; - + #elif defined (__PS3__) - + #elif defined _DURANGO - + #elif defined _WINDOWS64 //CMinecraftAudio audio; #else // PS4 - + #endif #ifdef _XBOX_ONE @@ -907,5 +907,5 @@ private: #endif }; -//singleton +//singleton //extern CMinecraftApp app; diff --git a/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h index e5dffb3c..21c42dea 100644 --- a/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h +++ b/Minecraft.Client/Common/GameRules/ApplySchematicRuleDefinition.h @@ -19,17 +19,17 @@ private: ConsoleSchematicFile::ESchematicRotation m_rotation; int m_dimension; - int64_t m_totalBlocksChanged; - int64_t m_totalBlocksChangedLighting; + __int64 m_totalBlocksChanged; + __int64 m_totalBlocksChangedLighting; bool m_completed; void updateLocationBox(); -public: +public: ApplySchematicRuleDefinition(LevelGenerationOptions *levelGenOptions); ~ApplySchematicRuleDefinition(); virtual ConsoleGameRules::EGameRuleType getActionType() { return ConsoleGameRules::eGameRuleType_ApplySchematic; } - + virtual void writeAttributes(DataOutputStream *dos, UINT numAttrs); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp index 0eef096b..4a4e27b2 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.cpp @@ -38,7 +38,7 @@ void ConsoleSchematicFile::save(DataOutputStream *dos) dos->writeInt(m_zSize); byteArray ba(new BYTE[ m_data.length ], m_data.length); - Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length, + Compression::getCompression()->CompressLZXRLE( ba.data, &ba.length, m_data.data, m_data.length); dos->writeInt(ba.length); @@ -71,13 +71,13 @@ void ConsoleSchematicFile::load(DataInputStream *dis) m_ySize = dis->readInt(); m_zSize = dis->readInt(); - int compressedSize = dis->readInt(); + int compressedSize = dis->readInt(); byteArray compressedBuffer(compressedSize); dis->readFully(compressedBuffer); if(m_data.data != NULL) { - delete [] m_data.data; + delete [] m_data.data; m_data.data = NULL; } @@ -145,7 +145,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis) double z = pos->get(2)->data; if( type == eTYPE_PAINTING || type == eTYPE_ITEM_FRAME ) - { + { x = ((IntTag *) eTag->get(L"TileX") )->data; y = ((IntTag *) eTag->get(L"TileY") )->data; z = ((IntTag *) eTag->get(L"TileZ") )->data; @@ -184,7 +184,7 @@ void ConsoleSchematicFile::save_tags(DataOutputStream *dos) delete tag; } -int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +__int64 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = max(destinationBox->x0, (double)chunk->x*16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); @@ -281,7 +281,7 @@ int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB // blockData[i] = Tile::whiteStone_Id; // } //} - + PIXBeginNamedEvent(0,"Setting Block data"); chunk->setBlockData(blockData); PIXEndNamedEvent(); @@ -323,7 +323,7 @@ int64_t ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkB // At the point that this is called, we have all the neighbouring chunks loaded in (and generally post-processed, apart from this lighting pass), so // we can do the sort of lighting that might propagate out of the chunk. -int64_t ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +__int64 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) { int xStart = max(destinationBox->x0, (double)chunk->x*16); int xEnd = min(destinationBox->x1, (double)((xStart>>4)<<4) + 16); @@ -447,7 +447,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, shared_ptr teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 ); if ( teCopy != NULL ) - { + { CompoundTag *teData = new CompoundTag(); te->save(teData); @@ -480,7 +480,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, for(AUTO_VAR(it, m_entities.begin()); it != m_entities.end();) { Vec3 *source = it->first; - + double targetX = source->x; double targetY = source->y + destinationBox->y0; double targetZ = source->z; @@ -500,7 +500,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, if( e->GetType() == eTYPE_PAINTING ) { shared_ptr painting = dynamic_pointer_cast(e); - + double tileX = painting->xTile; double tileZ = painting->zTile; schematicCoordToChunkCoord(destinationBox, painting->xTile, painting->zTile, rot, tileX, tileZ); @@ -513,7 +513,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox, else if( e->GetType() == eTYPE_ITEM_FRAME ) { shared_ptr frame = dynamic_pointer_cast(e); - + double tileX = frame->xTile; double tileZ = frame->zTile; schematicCoordToChunkCoord(destinationBox, frame->xTile, frame->zTile, rot, tileX, tileZ); @@ -561,7 +561,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l zStart-=1; else if(zStart < 0 && zStart%2 !=0) zStart-=1; - + // We want the end to be odd to have a total size that is even if(xEnd > 0 && xEnd%2 == 0) xEnd+=1; @@ -615,7 +615,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l // Every x is a whole row for(int xPos = xStart; xPos < xStart + xSize; ++xPos) - { + { int xc = xPos >> 4; int x0 = xPos - xc * 16; @@ -624,7 +624,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l if (x1 > 16) x1 = 16; for(int zPos = zStart; zPos < zStart + zSize;) - { + { int zc = zPos >> 4; int z0 = zStart - zc * 16; @@ -718,7 +718,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l { CompoundTag *eTag = new CompoundTag(); if( e->save(eTag) ) - { + { ListTag *pos = (ListTag *) eTag->getList(L"Pos"); pos->get(0)->data -= xStart; @@ -726,7 +726,7 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l pos->get(2)->data -= zStart; if( e->GetType() == eTYPE_PAINTING || e->GetType() == eTYPE_ITEM_FRAME ) - { + { ((IntTag *) eTag->get(L"TileX") )->data -= xStart; ((IntTag *) eTag->get(L"TileY") )->data -= yStart; ((IntTag *) eTag->get(L"TileZ") )->data -= zStart; @@ -767,7 +767,7 @@ void ConsoleSchematicFile::getBlocksAndData(LevelChunk *chunk, byteArray *data, // skyLightP += skyLightData.length; // return; //} - + bool bHasLower, bHasUpper; bHasLower = bHasUpper = false; int lowerY0, lowerY1, upperY0, upperY1; diff --git a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h index b0eebf9e..f37a6058 100644 --- a/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h +++ b/Minecraft.Client/Common/GameRules/ConsoleSchematicFile.h @@ -58,7 +58,7 @@ private: vector > m_tileEntities; vector< pair > m_entities; -public: +public: byteArray m_data; public: @@ -72,8 +72,8 @@ public: void save(DataOutputStream *dos); void load(DataInputStream *dis); - int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); - int64_t applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + __int64 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + __int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); void applyTileEntities(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); static void generateSchematicFile(DataOutputStream *dos, Level *level, int xStart, int yStart, int zStart, int xEnd, int yEnd, int zEnd, bool bSaveMobs, Compression::ECompressionTypes); diff --git a/Minecraft.Client/Common/GameRules/GameRule.h b/Minecraft.Client/Common/GameRules/GameRule.h index 3b9dba7e..bdc2ceff 100644 --- a/Minecraft.Client/Common/GameRules/GameRule.h +++ b/Minecraft.Client/Common/GameRules/GameRule.h @@ -14,7 +14,7 @@ public: typedef struct _ValueType { union{ - int64_t i64; + __int64 i64; int i; char c; bool b; @@ -44,7 +44,7 @@ public: virtual ~GameRule(); Connection *getConnection() { return m_connection; } - + ValueType getParameter(const wstring ¶meterName); void setParameter(const wstring ¶meterName,ValueType value); GameRuleDefinition *getGameRuleDefinition(); diff --git a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp index 373030d4..0c6a7804 100644 --- a/Minecraft.Client/Common/GameRules/GameRuleManager.cpp +++ b/Minecraft.Client/Common/GameRules/GameRuleManager.cpp @@ -77,7 +77,7 @@ WCHAR *GameRuleManager::wchAttrNameA[] = L"spawnY", // eGameRuleAttr_spawnY L"spawnZ", // eGameRuleAttr_spawnZ L"orientation", - L"dimension", + L"dimension", L"topTileId", // eGameRuleAttr_topTileId L"biomeId", // eGameRuleAttr_biomeId L"feature", // eGameRuleAttr_feature @@ -114,7 +114,7 @@ void GameRuleManager::loadGameRules(DLCPack *pack) readRuleFile(createdLevelGenerationOptions, dData, dSize, strings); createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC ); - + //createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_fromDLC ); dlcHeader->lgo = createdLevelGenerationOptions; @@ -130,12 +130,12 @@ void GameRuleManager::loadGameRules(DLCPack *pack) LevelGenerationOptions *createdLevelGenerationOptions = new LevelGenerationOptions(); // = loadGameRules(dData, dSize); //, strings); - + createdLevelGenerationOptions->setGrSource( new JustGrSource() ); readRuleFile(createdLevelGenerationOptions, dData, dSize, strings); createdLevelGenerationOptions->setSrc( LevelGenerationOptions::eSrc_tutorial ); - + //createdLevelGenerationOptions->set_DLCGameRulesFile( dlcFile ); createdLevelGenerationOptions->setLoadedData(); @@ -169,7 +169,7 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT app.DebugPrintf("\tversion=%d.\n", version); for (int i = 0; i < 8; i++) dis.readByte(); - + BYTE compression_type = dis.readByte(); app.DebugPrintf("\tcompressionType=%d.\n", compression_type); @@ -179,11 +179,11 @@ void GameRuleManager::loadGameRules(LevelGenerationOptions *lgo, byte *dIn, UINT decomp_len = dis.readInt(); app.DebugPrintf("\tcompr_len=%d.\n\tdecomp_len=%d.\n", compr_len, decomp_len); - + // Decompress File Body - byteArray content(new BYTE[decomp_len], decomp_len), + byteArray content(new BYTE[decomp_len], decomp_len), compr_content(new BYTE[compr_len], compr_len); dis.read(compr_content); @@ -256,7 +256,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) // Initialise output stream. ByteArrayOutputStream baos; DataOutputStream dos(&baos); - + // Write header. // VERSION NUMBER @@ -284,7 +284,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) compr_dos.writeInt( 0 ); // XmlObjects.length } else - { + { StringTable *st = m_currentGameRuleDefinitions->getStringTable(); if (st == NULL) @@ -316,9 +316,9 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) dos.writeInt( compr_ba.length ); // Write length dos.writeInt( compr_baos.buf.length ); dos.write(compr_ba); - + delete [] compr_ba.data; - + compr_dos.close(); compr_baos.close(); // -- END COMPRESSED -- // @@ -328,7 +328,7 @@ void GameRuleManager::saveGameRules(byte **dOut, UINT *dSize) *dOut = baos.buf.data; baos.buf.data = NULL; - + dos.close(); baos.close(); } @@ -383,7 +383,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT //DWORD dwLen = 0; //PBYTE pbData = dlcFile->getData(dwLen); //byteArray data(pbData,dwLen); - + byteArray data(dIn, dSize); ByteArrayInputStream bais(data); DataInputStream dis(&bais); @@ -391,7 +391,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT // Read File. // version_number - int64_t version = dis.readShort(); + __int64 version = dis.readShort(); unsigned char compressionType = 0; if(version == 0) { @@ -502,7 +502,7 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT } }*/ - // subfile + // subfile UINT numFiles = contentDis->readInt(); for (UINT i = 0; i < numFiles; i++) { @@ -570,10 +570,10 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT LevelGenerationOptions *GameRuleManager::readHeader(DLCGameRulesHeader *grh) { - LevelGenerationOptions *out = + LevelGenerationOptions *out = new LevelGenerationOptions(); - + out->setSrc(LevelGenerationOptions::eSrc_fromDLC); out->setGrSource(grh); addLevelGenerationOptions(out); @@ -733,7 +733,7 @@ LPCWSTR GameRuleManager::GetGameRulesString(const wstring &key) LEVEL_GEN_ID GameRuleManager::addLevelGenerationOptions(LevelGenerationOptions *lgo) { vector *lgs = m_levelGenerators.getLevelGenerators(); - + for (int i = 0; isize(); i++) if (lgs->at(i) == lgo) return i; @@ -753,7 +753,7 @@ void GameRuleManager::unloadCurrentGameRules() if (m_currentLevelGenerationOptions->isFromSave()) { m_levelGenerators.removeLevelGenerator( m_currentLevelGenerationOptions ); - + delete m_currentLevelGenerationOptions; } else if (m_currentLevelGenerationOptions->isFromDLC()) diff --git a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp index a36d8549..717b066e 100644 --- a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp +++ b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.cpp @@ -70,17 +70,17 @@ LevelGenerationOptions::~LevelGenerationOptions() { delete *it; } - + for(AUTO_VAR(it, m_biomeOverrides.begin()); it != m_biomeOverrides.end(); ++it) { delete *it; } - + for(AUTO_VAR(it, m_features.begin()); it != m_features.end(); ++it) { delete *it; } - + if (m_stringTable) if (!isTutorial()) delete m_stringTable; @@ -93,7 +93,7 @@ ConsoleGameRules::EGameRuleType LevelGenerationOptions::getActionType() { return void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttrs) { GameRuleDefinition::writeAttributes(dos, numAttrs + 5); - + ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnX); dos->writeUTF(_toString(m_spawnPos->x)); ConsoleGameRules::write(dos, ConsoleGameRules::eGameRuleAttr_spawnY); @@ -110,12 +110,12 @@ void LevelGenerationOptions::writeAttributes(DataOutputStream *dos, UINT numAttr void LevelGenerationOptions::getChildren(vector *children) { GameRuleDefinition::getChildren(children); - + vector used_schematics; for (AUTO_VAR(it, m_schematicRules.begin()); it != m_schematicRules.end(); it++) if ( !(*it)->isComplete() ) used_schematics.push_back( *it ); - + for(AUTO_VAR(it, m_structureRules.begin()); it!=m_structureRules.end(); it++) children->push_back( *it ); for(AUTO_VAR(it, used_schematics.begin()); it!=used_schematics.end(); it++) @@ -162,7 +162,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws { if(attributeName.compare(L"seed") == 0) { - m_seed = _fromString(attributeValue); + m_seed = _fromString<__int64>(attributeValue); app.DebugPrintf("LevelGenerationOptions: Adding parameter m_seed=%I64d\n",m_seed); } else if(attributeName.compare(L"spawnX") == 0) @@ -213,7 +213,7 @@ void LevelGenerationOptions::addAttribute(const wstring &attributeName, const ws app.DebugPrintf("LevelGenerationOptions: Adding parameter displayName=%ls\n", getDisplayName()); } else if(attributeName.compare(L"texturePackId") == 0) - { + { setRequiredTexturePackId( _fromString(attributeValue) ); setRequiresTexturePack( true ); app.DebugPrintf("LevelGenerationOptions: Adding parameter texturePackId=%0x\n", getRequiredTexturePackId()); @@ -290,14 +290,14 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, int for( AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); it++ ) { - ConsoleGenerateStructure *structureStart = *it; + ConsoleGenerateStructure *structureStart = *it; int minY = structureStart->getMinY(); if(minY < m_minY) m_minY = minY; } m_bHaveMinY = true; } - + // 4J Stu - We DO NOT intersect if our upper bound is below the lower bound for all schematics if( y1 < m_minY ) return false; @@ -313,7 +313,7 @@ bool LevelGenerationOptions::checkIntersects(int x0, int y0, int z0, int x1, int { for( AUTO_VAR(it, m_structureRules.begin()); it != m_structureRules.end(); it++ ) { - ConsoleGenerateStructure *structureStart = *it; + ConsoleGenerateStructure *structureStart = *it; intersects = structureStart->checkIntersects(x0,y0,z0,x1,y1,z1); if(intersects) break; } @@ -438,12 +438,12 @@ unordered_map *LevelGenerationOptions::getUnfin usedFiles.insert( (*it)->getSchematicName() ); // Clean schematic files. - unordered_map *out + unordered_map *out = new unordered_map(); for (AUTO_VAR(it, usedFiles.begin()); it!=usedFiles.end(); it++) out->insert( pair(*it, getSchematicFile(*it)) ); - - return out; + + return out; } void LevelGenerationOptions::reset_start() @@ -505,7 +505,7 @@ void LevelGenerationOptions::deleteBaseSaveData() { if(m_pbBaseSaveData) delete bool LevelGenerationOptions::hasLoadedData() { return m_hasLoadedData; } void LevelGenerationOptions::setLoadedData() { m_hasLoadedData = true; } -int64_t LevelGenerationOptions::getLevelSeed() { return m_seed; } +__int64 LevelGenerationOptions::getLevelSeed() { return m_seed; } Pos *LevelGenerationOptions::getSpawnPos() { return m_spawnPos; } bool LevelGenerationOptions::getuseFlatWorld() { return m_useFlatWorld; } diff --git a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h index 6ae6f033..0cc9da79 100644 --- a/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h +++ b/Minecraft.Client/Common/GameRules/LevelGenerationOptions.h @@ -19,7 +19,7 @@ class GrSource public: // 4J-JEV: // Moved all this here; I didn't like that all this header information - // was being mixed in with all the game information as they have + // was being mixed in with all the game information as they have // completely different lifespans. virtual bool requiresTexturePack()=0; @@ -146,7 +146,7 @@ public: private: // This should match the "MapOptionsRule" definition in the XML schema - int64_t m_seed; + __int64 m_seed; bool m_useFlatWorld; Pos *m_spawnPos; vector m_schematicRules; @@ -167,13 +167,13 @@ public: ~LevelGenerationOptions(); virtual ConsoleGameRules::EGameRuleType getActionType(); - + virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes); virtual void getChildren(vector *children); virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType); virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue); - int64_t getLevelSeed(); + __int64 getLevelSeed(); Pos *getSpawnPos(); bool getuseFlatWorld(); @@ -185,7 +185,7 @@ public: private: void clearSchematics(); -public: +public: ConsoleSchematicFile *loadSchematicFile(const wstring &filename, PBYTE pbData, DWORD dwLen); public: @@ -203,7 +203,7 @@ public: LPCWSTR getString(const wstring &key); unordered_map *getUnfinishedSchematicFiles(); - + // 4J-JEV: // ApplySchematicRules contain limited state // which needs to be reset BEFORE a new game starts. diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index 5fd72e40..2a80f80a 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -44,8 +44,8 @@ CGameNetworkManager g_NetworkManager; CPlatformNetworkManager *CGameNetworkManager::s_pPlatformNetworkManager; -int64_t CGameNetworkManager::messageQueue[512]; -int64_t CGameNetworkManager::byteQueue[512]; +__int64 CGameNetworkManager::messageQueue[512]; +__int64 CGameNetworkManager::byteQueue[512]; int CGameNetworkManager::messageQueuePos = 0; CGameNetworkManager::CGameNetworkManager() @@ -74,7 +74,7 @@ void CGameNetworkManager::Initialise() #else s_pPlatformNetworkManager = new CPlatformNetworkManagerStub(); #endif - s_pPlatformNetworkManager->Initialise( this, flagIndexSize ); + s_pPlatformNetworkManager->Initialise( this, flagIndexSize ); m_bNetworkThreadRunning = false; m_bInitialised = true; } @@ -104,7 +104,7 @@ void CGameNetworkManager::DoWork() if((g_NetworkManager.GetLockedProfile()!=-1) && iPrimaryPlayer!=-1 && bConnected == false && g_NetworkManager.IsInSession() ) { app.SetAction(iPrimaryPlayer,eAppAction_EthernetDisconnected); - } + } } break; case XN_LIVE_INVITE_ACCEPTED: @@ -161,12 +161,12 @@ bool CGameNetworkManager::_RunNetworkGame(LPVOID lpParameter) success = s_pPlatformNetworkManager->_RunNetworkGame(); if(!success) - { + { app.SetAction(ProfileManager.GetPrimaryPad(),eAppAction_ExitWorld,(void *)TRUE); return true; } } - + if( g_NetworkManager.IsLeavingGame() ) return false; app.SetGameStarted(true); @@ -188,12 +188,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame ProfileManager.SetDeferredSignoutEnabled(true); #endif - int64_t seed = 0; + __int64 seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; seed = param->seed; - + app.setLevelGenerationOptions(param->levelGen); if(param->levelGen != NULL) { @@ -204,12 +204,12 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame } else { - param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed(); + param->seed = seed = app.getLevelGenerationOptions()->getLevelSeed(); } } } - static int64_t sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running + static __int64 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running ServerStoppedCreate(false); if( g_NetworkManager.IsHost() ) { @@ -227,7 +227,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame ServerReadyWait(); ServerReadyDestroy(); - if( MinecraftServer::serverHalted() ) + if( MinecraftServer::serverHalted() ) return false; // printf("Server ready to go!\n"); @@ -238,7 +238,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame } #ifndef _XBOX - Minecraft *pMinecraft = Minecraft::GetInstance(); + Minecraft *pMinecraft = Minecraft::GetInstance(); // Make sure that we have transitioned through any joining/creating stages and are actually playing the game, so that we know the players should be valid bool changedMessage = false; while(!IsReadyToPlayOrIdle()) @@ -458,7 +458,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame return false; } - + if(g_NetworkManager.IsLeavingGame() || !IsInSession() ) { for(AUTO_VAR(it, createdConnections.begin()); it < createdConnections.end(); ++it) @@ -754,7 +754,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin ProfileManager.SetPrimaryPad(iPad); g_NetworkManager.SetLocalGame(false); - + // If the player was signed in before selecting play, we'll not have read the profile yet, so query the sign-in status to get this to happen ProfileManager.QuerySigninStatus(); @@ -770,7 +770,7 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin pInviteInfo ); // pInviteInfo if( !success ) { - app.DebugPrintf( "Failed joining game from invite\n" ); + app.DebugPrintf( "Failed joining game from invite\n" ); } } } @@ -816,7 +816,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) Compression::UseDefaultThreadStorage(); Tile::CreateNewThreadStorage(); IntCache::CreateNewThreadStorage(); - + g_NetworkManager.m_bNetworkThreadRunning = true; bool success = g_NetworkManager._RunNetworkGame(lpParameter); g_NetworkManager.m_bNetworkThreadRunning = false; @@ -828,7 +828,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) Sleep(1); } ui.CleanUpSkinReload(); - if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None) + if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None) { app.SetDisconnectReason( DisconnectPacket::eDisconnect_ConnectionCreationFailed ); } @@ -850,7 +850,7 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) int CGameNetworkManager::ServerThreadProc( void* lpParameter ) { - int64_t seed = 0; + __int64 seed = 0; if(lpParameter != NULL) { NetworkGameInitData *param = (NetworkGameInitData *)lpParameter; @@ -861,7 +861,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter ) SetThreadName(-1, "Minecraft Server thread"); AABB::CreateNewThreadStorage(); Vec3::CreateNewThreadStorage(); - IntCache::CreateNewThreadStorage(); + IntCache::CreateNewThreadStorage(); Compression::UseDefaultThreadStorage(); OldChunkStorage::UseDefaultThreadStorage(); Entity::useSmallIds(); @@ -869,7 +869,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter ) Tile::CreateNewThreadStorage(); MinecraftServer::main(seed, lpParameter); //saveData, app.GetGameHostOption(eGameHostOption_All)); - + Tile::ReleaseThreadStorage(); AABB::ReleaseThreadStorage(); Vec3::ReleaseThreadStorage(); @@ -926,7 +926,7 @@ int CGameNetworkManager::ExitAndJoinFromInviteThreadProc( void* lpParam ) // The pair of methods MustSignInReturned_0 & PSNSignInReturned_0 handle this int CGameNetworkManager::MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result) { - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { #ifdef __PS3__ SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_0, pParam,true); @@ -986,7 +986,7 @@ int CGameNetworkManager::PSNSignInReturned_0(void* pParam, bool bContinue, int i // The pair of methods MustSignInReturned_1 & PSNSignInReturned_1 handle this int CGameNetworkManager::MustSignInReturned_1(void *pParam,int iPad,C4JStorage::EMessageResult result) { - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { #ifdef __PS3__ SQRNetworkManager_PS3::AttemptPSNSignIn(&CGameNetworkManager::PSNSignInReturned_1, pParam,true); @@ -1018,7 +1018,7 @@ int CGameNetworkManager::PSNSignInReturned_1(void* pParam, bool bContinue, int i #elif defined __ORBIS__ // TODO: No Orbis equivalent (should there be?) #endif - + } } @@ -1043,7 +1043,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) Vec3::UseDefaultThreadStorage(); Compression::UseDefaultThreadStorage(); - Minecraft *pMinecraft = Minecraft::GetInstance(); + Minecraft *pMinecraft = Minecraft::GetInstance(); MinecraftServer *pServer = MinecraftServer::getInstance(); #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ @@ -1082,7 +1082,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) ); pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME ); } - + #else pMinecraft->progressRenderer->progressStartNoAbort( g_NetworkManager.CorrectErrorIDS(IDS_CONNECTION_LOST_LIVE_NO_EXIT) ); pMinecraft->progressRenderer->progressStage( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME ); @@ -1096,7 +1096,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) // wait for the server to be in a non-ticking state pServer->m_serverPausedEvent->WaitForSignal(INFINITE); - + #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ // Swap these two messages around as one is too long to display at 480 pMinecraft->progressRenderer->progressStartNoAbort( IDS_PROGRESS_CONVERTING_TO_OFFLINE_GAME ); @@ -1158,7 +1158,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) { Sleep(1); } - + // Reset this flag as the we don't need to know that we only lost the room only from this point onwards, the behaviour is exactly the same g_NetworkManager.m_bLastDisconnectWasLostRoomOnly = false; g_NetworkManager.m_bFullSessionMessageOnNextSessionChange = false; @@ -1189,7 +1189,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) { Sleep(1); } - + // Restore the network player of all the server players that are local if( pServer != NULL ) { @@ -1218,7 +1218,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) } } } - + pMinecraft->progressRenderer->progressStagePercentage(100); #ifndef _XBOX @@ -1240,7 +1240,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam ) #endif // Start the game again - app.SetGameStarted(true); + app.SetGameStarted(true); app.SetXuiServerAction(ProfileManager.GetPrimaryPad(),eXuiServerAction_PauseServer,(void *)FALSE); app.SetChangingSessionType(false); app.SetReallyChangingSessionType(false); @@ -1294,7 +1294,7 @@ void CGameNetworkManager::StateChange_AnyToJoining() app.DebugPrintf("Disabling Guest Signin\n"); XEnableGuestSignin(FALSE); Minecraft::GetInstance()->clearPendingClientTextureRequests(); - + ConnectionProgressParams *param = new ConnectionProgressParams(); param->iPad = ProfileManager.GetPrimaryPad(); param->stringId = -1; @@ -1342,7 +1342,7 @@ void CGameNetworkManager::StateChange_AnyToStarting() completionData->type = e_ProgressCompletion_CloseAllPlayersUIScenes; completionData->iPad = ProfileManager.GetPrimaryPad(); loadingParams->completionData = completionData; - + ui.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_FullscreenProgress, loadingParams); } } @@ -1463,7 +1463,7 @@ void CGameNetworkManager::PlayerJoining( INetworkPlayer *pNetworkPlayer ) bool multiplayer = g_NetworkManager.GetPlayerCount() > 1, localgame = g_NetworkManager.IsLocalGame(); for (int iPad=0; iPadIsHost() ) - { + { for(int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { if(Minecraft::GetInstance()->localplayers[idx] != NULL) @@ -1544,7 +1544,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * } // Need to check we're signed in to PSN - bool isSignedInLive = true; + bool isSignedInLive = true; bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable(); int iPadNotSignedInLive = -1; for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++) @@ -1584,7 +1584,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, iPadNotSignedInLive, NULL, NULL, app.GetStringTable()); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -1601,10 +1601,10 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * { m_pInviteInfo = (INVITE_INFO *) pInviteInfo; m_iPlayerInvited = userIndex; - + m_pUpsell = new PsPlusUpsellWrapper(index); m_pUpsell->displayUpsell(); - + return; } } @@ -1612,7 +1612,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * #ifdef __PSVITA__ // Need to check we're signed in to PSN - bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()); + bool isSignedInLive = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()); if (!isSignedInLive) { // Determine why they're not "signed in live" @@ -1625,7 +1625,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * // ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable()); // } // else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_PRO_NOTONLINE_ACCEPT; @@ -1648,9 +1648,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * // 4J-PB we shouldn't bring any inactive players into the game, except for the invited player (who may be an inactive player) // 4J Stu - If we are not in a game, then bring in all players signed in if(index==userIndex || pMinecraft->localplayers[index]!=NULL ) - { + { ++joiningUsers; - if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; + if( !ProfileManager.AllowedToPlayMultiplayer(index) ) noPrivileges = true; localUsersMask |= GetLocalPlayerMask( index ); } } @@ -1667,7 +1667,7 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; #endif - + #if defined(_XBOX) || defined(__PS3__) if(joiningUsers > 1 && !RenderManager.IsHiDef() && userIndex != ProfileManager.GetPrimaryPad()) { @@ -1716,9 +1716,9 @@ void CGameNetworkManager::GameInviteReceived( int userIndex, const INVITE_INFO * } #endif if( !g_NetworkManager.IsInSession() ) - { + { #ifndef __PS3__ - HandleInviteWhenInMenus(userIndex, pInviteInfo); + HandleInviteWhenInMenus(userIndex, pInviteInfo); #else // PS3 is more complicated here - we need to make sure that the player is online. If they are then we can do the same as the xbox, if not we need to try and get them online and then, if they do sign in, go down the same path if(ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad())) @@ -1771,7 +1771,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I if(!ProfileManager.IsFullVersion()) { // The marketplace will fail with the primary player set to -1 - ProfileManager.SetPrimaryPad(userIndex); + ProfileManager.SetPrimaryPad(userIndex); app.SetAction(userIndex,eAppAction_DashboardTrialJoinFromInvite); } @@ -1809,7 +1809,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I ProfileManager.QuerySigninStatus(); // 4J-PB - clear any previous connection errors - Minecraft::GetInstance()->clearConnectionFailed(); + Minecraft::GetInstance()->clearConnectionFailed(); g_NetworkManager.SetLocalGame(false); @@ -1819,7 +1819,7 @@ void CGameNetworkManager::HandleInviteWhenInMenus( int userIndex, const INVITE_I bool success = g_NetworkManager.JoinGameFromInviteInfo( userIndex, localUsersMask, pInviteInfo ); if( !success ) { - app.DebugPrintf( "Failed joining game from invite\n" ); + app.DebugPrintf( "Failed joining game from invite\n" ); } } } diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.h b/Minecraft.Client/Common/Network/GameNetworkManager.h index 482cfd2a..1bb532da 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.h +++ b/Minecraft.Client/Common/Network/GameNetworkManager.h @@ -99,11 +99,11 @@ public: void SetSessionsUpdatedCallback( void (*SessionsUpdatedCallback)(LPVOID pParam), LPVOID pSearchParam ); void GetFullFriendSessionInfo( FriendSessionInfo *foundSession, void (* FriendSessionUpdatedFn)(bool success, void *pParam), void *pParam ); void ForceFriendsSessionRefresh(); - + // Session joining and leaving bool JoinGameFromInviteInfo( int userIndex, int userMask, const INVITE_INFO *pInviteInfo); - eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask); + eJoinGameResult JoinGame(FriendSessionInfo *searchResult, int localUsersMask); static void CancelJoinGame(LPVOID lpParam); // Not part of the shared interface bool LeaveGame(bool bMigrateHost); static int JoinFromInvite_SignInReturned(void *pParam,bool bContinue, int iPad); @@ -112,13 +112,13 @@ public: void ResetLeavingGame(); // Threads - + bool IsNetworkThreadRunning(); static int RunNetworkGameThreadProc( void* lpParameter ); static int ServerThreadProc( void* lpParameter ); static int ExitAndJoinFromInviteThreadProc( void* lpParam ); -#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__) +#if (defined __PS3__) || (defined __ORBIS__) || (defined __PSVITA__) static int MustSignInReturned_0(void *pParam,int iPad,C4JStorage::EMessageResult result); static int PSNSignInReturned_0(void* pParam, bool bContinue, int iPad); @@ -129,7 +129,7 @@ public: static void _LeaveGame(); static int ChangeSessionTypeThreadProc( void* lpParam ); - // System flags + // System flags void SystemFlagSet(INetworkPlayer *pNetworkPlayer, int index); bool SystemFlagGet(INetworkPlayer *pNetworkPlayer, int index); @@ -144,8 +144,8 @@ public: void ServerStoppedCreate(bool create); // Create the signal void ServerStopped(); // Signal that we are ready - void ServerStoppedWait(); // Wait for the signal - void ServerStoppedDestroy(); // Destroy signal + void ServerStoppedWait(); // Wait for the signal + void ServerStoppedDestroy(); // Destroy signal bool ServerStoppedValid(); // Is non-NULL #ifdef __PSVITA__ @@ -163,9 +163,9 @@ public: // Used for debugging output static const int messageQueue_length = 512; - static int64_t messageQueue[messageQueue_length]; + static __int64 messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static int64_t byteQueue[byteQueue_length]; + static __int64 byteQueue[byteQueue_length]; static int messageQueuePos; // Methods called from PlatformNetworkManager diff --git a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp index d745fb85..ccb1957d 100644 --- a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp +++ b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.cpp @@ -25,11 +25,11 @@ static SceRemoteStorageStatus statParams; // { // app.DebugPrintf("remoteStorageGetCallback err : 0x%08x\n"); // } -// +// // void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code) // { // app.DebugPrintf("remoteStorageCallback err : 0x%08x\n"); -// +// // app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, NULL); // } @@ -161,17 +161,17 @@ ESavePlatform SonyRemoteStorage::getSavePlatform() } -int64_t SonyRemoteStorage::getSaveSeed() +__int64 SonyRemoteStorage::getSaveSeed() { if(m_getInfoStatus != e_infoFound) return 0; DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription; char seedString[17]; - ZeroMemory(seedString,17); + ZeroMemory(seedString,17); memcpy(seedString, pDescData->m_seed,16); - uint64_t seed = 0; + __uint64 seed = 0; std::stringstream ss; ss << seedString; ss >> std::hex >> seed; @@ -185,7 +185,7 @@ unsigned int SonyRemoteStorage::getSaveHostOptions() DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription; char optionsString[9]; - ZeroMemory(optionsString,9); + ZeroMemory(optionsString,9); memcpy(optionsString, pDescData->m_hostOptions,8); unsigned int uiHostOptions = 0; @@ -202,7 +202,7 @@ unsigned int SonyRemoteStorage::getSaveTexturePack() DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription; char textureString[9]; - ZeroMemory(textureString,9); + ZeroMemory(textureString,9); memcpy(textureString, pDescData->m_texturePack,8); unsigned int uiTexturePack = 0; @@ -219,9 +219,9 @@ const char* SonyRemoteStorage::getRemoteSaveFilename() int SonyRemoteStorage::getSaveFilesize() { - if(m_getInfoStatus == e_infoFound) + if(m_getInfoStatus == e_infoFound) { - return m_remoteFileInfo->fileSize; + return m_remoteFileInfo->fileSize; } return 0; } @@ -284,9 +284,9 @@ bool SonyRemoteStorage::saveIsAvailable() if(m_getInfoStatus != e_infoFound) return false; #ifdef __PS3__ - return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA); + return (getSavePlatform() == SAVE_FILE_PLATFORM_PSVITA); #elif defined __PSVITA__ - return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3); + return (getSavePlatform() == SAVE_FILE_PLATFORM_PS3); #else // __ORBIS__ return true; #endif @@ -294,7 +294,7 @@ bool SonyRemoteStorage::saveIsAvailable() int SonyRemoteStorage::getDataProgress() { - int64_t time = System::currentTimeMillis(); + __int64 time = System::currentTimeMillis(); int elapsedSecs = (time - m_startTime) / 1000; int progVal = m_dataProgress + (elapsedSecs/3); if(progVal > 95) @@ -310,15 +310,15 @@ bool SonyRemoteStorage::shutdown() if(m_bInitialised) { int ret = sceRemoteStorageTerm(); - if(ret >= 0) + if(ret >= 0) { app.DebugPrintf("Term request done \n"); m_bInitialised = false; free(m_memPoolBuffer); m_memPoolBuffer = NULL; return true; - } - else + } + else { app.DebugPrintf("Error in Term request: 0x%x \n", ret); return false; diff --git a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h index 3967a109..f435848e 100644 --- a/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h +++ b/Minecraft.Client/Common/Network/Sony/SonyRemoteStorage.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "..\..\Common\Network\Sony\sceRemoteStorage\header\sceRemoteStorage.h" @@ -42,7 +42,7 @@ public: SceRemoteStorageData* m_remoteFileInfo; class DescriptionData - { + { // this stuff is read from a JSON query, so it all has to be text based, max 256 bytes public: char m_platform[4]; @@ -72,7 +72,7 @@ public: const char* getLocalFilename(); const char* getSaveNameUTF8(); ESavePlatform getSavePlatform(); - int64_t getSaveSeed(); + __int64 getSaveSeed(); unsigned int getSaveHostOptions(); unsigned int getSaveTexturePack(); @@ -97,7 +97,7 @@ public: static int LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes); static int setDataThread(void* lpParam); - SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {} + SonyRemoteStorage() : m_memPoolBuffer(NULL), m_bInitialised(false),m_getInfoStatus(e_noInfoFound) {} protected: const char* getRemoteSaveFilename(); @@ -111,7 +111,7 @@ protected: unsigned int m_thumbnailDataSize; C4JThread* m_SetDataThread; PSAVE_INFO m_setDataSaveInfo; - int64_t m_startTime; + __int64 m_startTime; bool m_bAborting; bool m_bTransferStarted; diff --git a/Minecraft.Client/Common/Tutorial/Tutorial.cpp b/Minecraft.Client/Common/Tutorial/Tutorial.cpp index f7e44b17..b0a0d665 100644 --- a/Minecraft.Client/Common/Tutorial/Tutorial.cpp +++ b/Minecraft.Client/Common/Tutorial/Tutorial.cpp @@ -41,7 +41,7 @@ bool Tutorial::PopupMessageDetails::isSameContent(PopupMessageDetails *other) void Tutorial::staticCtor() { - // + // /* ***** ***** @@ -72,7 +72,7 @@ void Tutorial::staticCtor() s_completableTasks.push_back( e_Tutorial_State_Enchanting ); s_completableTasks.push_back( e_Tutorial_Hint_Hold_To_Mine ); - s_completableTasks.push_back( e_Tutorial_Hint_Tool_Damaged ); + s_completableTasks.push_back( e_Tutorial_Hint_Tool_Damaged ); s_completableTasks.push_back( e_Tutorial_Hint_Swim_Up ); s_completableTasks.push_back( e_Tutorial_Hint_Unused_2 ); @@ -164,7 +164,7 @@ void Tutorial::staticCtor() s_completableTasks.push_back( e_Tutorial_Hint_Thin_Glass ); s_completableTasks.push_back( e_Tutorial_Hint_Melon ); s_completableTasks.push_back( e_Tutorial_Hint_Vine ); - s_completableTasks.push_back( e_Tutorial_Hint_Fence_Gate ); + s_completableTasks.push_back( e_Tutorial_Hint_Fence_Gate ); s_completableTasks.push_back( e_Tutorial_Hint_Mycel ); s_completableTasks.push_back( e_Tutorial_Hint_Water_Lily ); s_completableTasks.push_back( e_Tutorial_Hint_Nether_Brick ); @@ -448,7 +448,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad ) if(!isHintCompleted(e_Tutorial_Hint_Detector_Rail)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Detector_Rail, this, detectorRailItems, 1 ) ); int tallGrassItems[] = {Tile::tallgrass_Id}; - if(!isHintCompleted(e_Tutorial_Hint_Tall_Grass)) + if(!isHintCompleted(e_Tutorial_Hint_Tall_Grass)) { addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Tall_Grass, this, tallGrassItems, 1, -1, TallGrass::DEAD_SHRUB ) ); addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Tall_Grass, this, tallGrassItems, 1, -1, TallGrass::TALL_GRASS ) ); @@ -731,7 +731,7 @@ Tutorial::Tutorial(int iPad, bool isFullTutorial /*= false*/) : m_iPad( iPad ) int potatoItems[] = {Tile::potatoes_Id}; if(!isHintCompleted(e_Tutorial_Hint_Potato)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Potato, this, potatoItems, 1, -1, -1, 7 ) ); - + int carrotItems[] = {Tile::carrots_Id}; if(!isHintCompleted(e_Tutorial_Hint_Carrot)) addHint(e_Tutorial_State_Gameplay, new LookAtTileHint(e_Tutorial_Hint_Carrot, this, carrotItems, 1, -1, -1, 7 ) ); @@ -1208,7 +1208,7 @@ void Tutorial::tick() } else if(m_freezeTime && m_timeFrozen && m_fullTutorialComplete) { - int64_t currentTime = pMinecraft->level->getTime(); + __int64 currentTime = pMinecraft->level->getTime(); int currentDayTime = (currentTime % Level::TICKS_PER_DAY); int timeToAdd = 0; if(currentDayTime > m_iTutorialFreezeTimeValue) @@ -1219,7 +1219,7 @@ void Tutorial::tick() { timeToAdd = m_iTutorialFreezeTimeValue - currentDayTime; } - int64_t targetTime = currentTime + timeToAdd; + __int64 targetTime = currentTime + timeToAdd; MinecraftServer::SetTimeOfDay(-1); MinecraftServer::SetTime(targetTime); pMinecraft->level->setOverrideTimeOfDay(-1); @@ -1228,7 +1228,7 @@ void Tutorial::tick() } if(!m_allowShow) - { + { if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) { uiTempDisabled = true; @@ -1264,7 +1264,7 @@ void Tutorial::tick() app.TutorialSceneNavigateBack(m_iPad); m_bSceneIsSplitscreen=app.GetLocalPlayerCount()>1; if(m_bSceneIsSplitscreen) - { + { app.NavigateToScene(m_iPad, eUIComponent_TutorialPopup,(void *)this, false, false, &m_hTutorialScene); } else @@ -1359,7 +1359,7 @@ void Tutorial::tick() { isCurrentTask = false; if( - ( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) ) + ( !task->ShowMinimumTime() || ( task->hasBeenActivated() && (lastMessageTime + m_iTutorialMinimumDisplayMessageTime ) < GetTickCount() ) ) && task->isCompleted() ) { @@ -1503,7 +1503,7 @@ void Tutorial::tick() message->m_promptId = currentTask[m_CurrentState]->getPromptId(); message->m_allowFade = currentTask[m_CurrentState]->AllowFade(); setMessage( message ); - currentTask[m_CurrentState]->TaskReminders()? m_iTaskReminders = 1 : m_iTaskReminders = 0; + currentTask[m_CurrentState]->TaskReminders()? m_iTaskReminders = 1 : m_iTaskReminders = 0; } else { @@ -1636,7 +1636,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) bool messageShown = false; DWORD time = GetTickCount(); if(message != NULL && (message->m_forceDisplay || hintsOn) && - (!message->m_delay || + (!message->m_delay || ( (m_hintDisplayed && (time - m_lastHintDisplayedTime) > m_iTutorialHintDelayTime ) || (!m_hintDisplayed && (time - lastMessageTime) > m_iTutorialMinimumDisplayMessageTime ) @@ -1648,7 +1648,7 @@ bool Tutorial::setMessage(TutorialHint *hint, PopupMessageDetails *message) if(messageShown) { - m_lastHintDisplayedTime = time; + m_lastHintDisplayedTime = time; m_hintDisplayed = true; if(hint!=NULL) setHintCompleted( hint ); } @@ -1672,7 +1672,7 @@ void Tutorial::showTutorialPopup(bool show) m_allowShow = show; if(!show) - { + { if( currentTask[m_CurrentState] != NULL && (!currentTask[m_CurrentState]->AllowFade() || (lastMessageTime + m_iTutorialDisplayMessageTime ) > GetTickCount() ) ) { uiTempDisabled = true; @@ -2099,7 +2099,7 @@ void Tutorial::changeTutorialState(eTutorial_State newState, UIScene *scene /*= // The action that caused the change of state may also have completed the current task if( currentTask[m_CurrentState] != NULL && currentTask[m_CurrentState]->isCompleted() ) { - activeTasks[m_CurrentState].erase( find( activeTasks[m_CurrentState].begin(), activeTasks[m_CurrentState].end(), currentTask[m_CurrentState]) ); + activeTasks[m_CurrentState].erase( find( activeTasks[m_CurrentState].begin(), activeTasks[m_CurrentState].end(), currentTask[m_CurrentState]) ); if( activeTasks[m_CurrentState].size() > 0 ) { diff --git a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp index bad12b3f..a418fcda 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Panorama.cpp @@ -47,7 +47,7 @@ void UIComponent_Panorama::tick() EnterCriticalSection(&pMinecraft->m_setLevelCS); if(pMinecraft->level!=NULL) { - int64_t i64TimeOfDay =0; + __int64 i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { @@ -104,7 +104,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp IggyPlayerSetDisplaySize( getMovie(), m_movieWidth, m_movieHeight ); IggyPlayerDrawTilesStart ( getMovie() ); - + m_renderWidth = tileWidth; m_renderHeight = tileHeight; IggyPlayerDrawTile ( getMovie() , @@ -112,7 +112,7 @@ void UIComponent_Panorama::render(S32 width, S32 height, C4JRender::eViewportTyp tileYStart , tileXStart + tileWidth , tileYStart + tileHeight , - 0 ); + 0 ); IggyPlayerDrawTilesEnd ( getMovie() ); } else diff --git a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp index d6f81a60..dfdea93e 100644 --- a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp +++ b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.cpp @@ -24,7 +24,7 @@ bool UIControl_SpaceIndicatorBar::setupControl(UIScene *scene, IggyValuePath *pa return success; } -void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, int64_t min, int64_t max) +void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, __int64 min, __int64 max) { m_label = label; m_id = id; @@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset() setSaveGameOffset(0.0f); } -void UIControl_SpaceIndicatorBar::addSave(int64_t size) +void UIControl_SpaceIndicatorBar::addSave(__int64 size) { float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min); - m_sizeAndOffsets.push_back( pair(size, startPercent) ); + m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) ); m_currentTotal += size; setTotalSize(m_currentTotal); @@ -75,7 +75,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) { if(index >= 0 && index < m_sizeAndOffsets.size()) { - pair values = m_sizeAndOffsets[index]; + pair<__int64,float> values = m_sizeAndOffsets[index]; setSaveSize(values.first); setSaveGameOffset(values.second); } @@ -86,7 +86,7 @@ void UIControl_SpaceIndicatorBar::selectSave(int index) } } -void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) +void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) { m_currentSave = size; @@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value ); } -void UIControl_SpaceIndicatorBar::setTotalSize(int64_t size) +void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size) { float percent = (float)((m_currentTotal-m_min))/(m_max-m_min); diff --git a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h index 08e00da9..39f9a746 100644 --- a/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h +++ b/Minecraft.Client/Common/UI/UIControl_SpaceIndicatorBar.h @@ -6,28 +6,28 @@ class UIControl_SpaceIndicatorBar : public UIControl_Base { private: IggyName m_setSaveSizeFunc, m_setTotalSizeFunc, m_setSaveGameOffsetFunc; - int64_t m_min; - int64_t m_max; - int64_t m_currentSave, m_currentTotal; + __int64 m_min; + __int64 m_max; + __int64 m_currentSave, m_currentTotal; float m_currentOffset; - vector > m_sizeAndOffsets; + vector > m_sizeAndOffsets; public: UIControl_SpaceIndicatorBar(); virtual bool setupControl(UIScene *scene, IggyValuePath *parent, const string &controlName); - void init(const wstring &label, int id, int64_t min, int64_t max); + void init(const wstring &label, int id, __int64 min, __int64 max); virtual void ReInit(); void reset(); - void addSave(int64_t size); + void addSave(__int64 size); void selectSave(int index); private: - void setSaveSize(int64_t size); - void setTotalSize(int64_t totalSize); + void setSaveSize(__int64 size); + void setTotalSize(__int64 totalSize); void setSaveGameOffset(float offset); }; \ No newline at end of file diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 34afbc71..eb33b6b3 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -124,7 +124,7 @@ extern "C" void *__real_malloc(size_t t); extern "C" void __real_free(void *t); #endif -int64_t UIController::iggyAllocCount = 0; +__int64 UIController::iggyAllocCount = 0; static unordered_map allocations; static void * RADLINK AllocateFunction ( void * alloc_callback_user_data , size_t size_requested , size_t * size_returned ) { @@ -272,7 +272,7 @@ void UIController::postInit() IggySetTextureSubstitutionCallbacks ( &UIController::TextureSubstitutionCreateCallback , &UIController::TextureSubstitutionDestroyCallback, this ); SetupFont(); - // + // loadSkins(); for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) @@ -402,7 +402,7 @@ void UIController::tick() EnderDragonRenderer::bossInstance = nullptr; // Clear out the cached movie file data - int64_t currentTime = System::currentTimeMillis(); + __int64 currentTime = System::currentTimeMillis(); for(AUTO_VAR(it, m_cachedMovieData.begin()); it != m_cachedMovieData.end();) { if(it->second.m_expiry < currentTime) @@ -522,7 +522,7 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - int64_t totalStatic = 0; + __int64 totalStatic = 0; while(res = IggyDebugGetMemoryUseInfo ( NULL , lib , "" , @@ -632,7 +632,7 @@ void UIController::CleanUpSkinReload() { if(!Minecraft::GetInstance()->skins->getSelected()->hasAudio()) { -#ifdef _DURANGO +#ifdef _DURANGO DWORD result = StorageManager.UnmountInstalledDLC(L"TPACK"); #else DWORD result = StorageManager.UnmountInstalledDLC("TPACK"); @@ -653,7 +653,7 @@ void UIController::CleanUpSkinReload() byteArray UIController::getMovieData(const wstring &filename) { // Cache everything we load in the current tick - int64_t targetTime = System::currentTimeMillis() + (1000LL * 60); + __int64 targetTime = System::currentTimeMillis() + (1000LL * 60); AUTO_VAR(it,m_cachedMovieData.find(filename)); if(it == m_cachedMovieData.end() ) { @@ -699,7 +699,7 @@ void UIController::handleInput() { #ifdef _DURANGO // 4J-JEV: Added exception for primary play who migh've uttered speech commands. - if(iPad != ProfileManager.GetPrimaryPad() + if(iPad != ProfileManager.GetPrimaryPad() && (!InputManager.IsPadConnected(iPad) || !InputManager.IsPadLocked(iPad)) ) continue; #endif for(unsigned int key = 0; key <= ACTION_MAX_MENU; ++key) @@ -775,7 +775,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) { // no active touch? clear active and highlighted touch UI elements m_ActiveUIElement = NULL; - m_HighlightedUIElement = NULL; + m_HighlightedUIElement = NULL; // fullscreen first UIScene *pScene=m_groups[(int)eUIGroup_Fullscreen]->getCurrentScene(); @@ -825,7 +825,7 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) } } } - } + } else if(m_bTouchscreenPressed && pTouchData->reportNum==1) { // fullscreen first @@ -1006,8 +1006,8 @@ void UIController::handleKeyPress(unsigned int iPad, unsigned int key) //!(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<closeAllScenes(); m_groups[(int)group]->getTooltips()->SetTooltips(-1); - + // This should cause the popup to dissappear TutorialPopupInfo popupInfo; if(m_groups[(int)group]->getTutorialPopup()) m_groups[(int)group]->getTutorialPopup()->SetTutorialDescription(&popupInfo); @@ -1865,7 +1865,7 @@ void UIController::SetMenuDisplayed(int iPad,bool bVal) #ifdef _DURANGO // 4J-JEV: When in-game, allow player to toggle the 'Pause' and 'IngameInfo' menus via Kinnect. - if (Minecraft::GetInstance()->running) + if (Minecraft::GetInstance()->running) InputManager.SetEnabledGtcButtons(_360_GTC_MENU | _360_GTC_PAUSE | _360_GTC_VIEW); #endif } @@ -2280,7 +2280,7 @@ void UIController::SetTrialTimerLimitSecs(unsigned int uiSeconds) void UIController::UpdateTrialTimer(unsigned int iPad) { - WCHAR wcTime[20]; + WCHAR wcTime[20]; DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); @@ -2342,7 +2342,7 @@ void UIController::ShowAutosaveCountdownTimer(bool show) void UIController::UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { #if !(defined(_XBOX_ONE) || defined(__ORBIS__)) - WCHAR wcAutosaveCountdown[100]; + WCHAR wcAutosaveCountdown[100]; swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); if(m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()) m_groups[(int)eUIGroup_Fullscreen]->getPressStartToPlay()->setTrialTimer(wcAutosaveCountdown); #endif @@ -2507,7 +2507,7 @@ C4JStorage::EMessageResult UIController::RequestUGCMessageBox(UINT title/* = -1 #ifdef __ORBIS__ // Show the vague UGC system message in addition to our message ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_UGC_RESTRICTION, iPad ); - return C4JStorage::EMessage_ResultAccept; + return C4JStorage::EMessage_ResultAccept; #elif defined(__PSVITA__) ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, iPad ); UINT uiIDA[1]; @@ -2544,7 +2544,7 @@ C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(UINT #ifdef __ORBIS__ // Show the vague UGC system message in addition to our message ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_UGC_RESTRICTION, iPad ); - return C4JStorage::EMessage_ResultAccept; + return C4JStorage::EMessage_ResultAccept; #elif defined(__PSVITA__) ProfileManager.ShowSystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_AGE_RESTRICTION, iPad ); return C4JStorage::EMessage_ResultAccept; @@ -2584,7 +2584,7 @@ void UIController::setFontCachingCalculationBuffer(int length) } } -// Returns the first scene of given type if it exists, NULL otherwise +// Returns the first scene of given type if it exists, NULL otherwise UIScene *UIController::FindScene(EUIScene sceneType) { UIScene *pScene = NULL; @@ -2723,7 +2723,7 @@ void UIController::TouchBoxesClear(UIScene *pUIScene) for (AUTO_VAR(it, m_TouchBoxes[eUIGroup][eUILayer][eUIscene].begin()); it != itEnd; it++) { UIELEMENT *element=(UIELEMENT *)*it; - delete element; + delete element; } m_TouchBoxes[eUIGroup][eUILayer][eUIscene].clear(); } @@ -2759,7 +2759,7 @@ bool UIController::TouchBoxHit(UIScene *pUIScene,S32 x, S32 y) return true; } } - } + } } //app.DebugPrintf("MISS at x = %i y = %i\n", (int)x, (int)y); diff --git a/Minecraft.Client/Common/UI/UIController.h b/Minecraft.Client/Common/UI/UIController.h index f8f695bd..ef064f80 100644 --- a/Minecraft.Client/Common/UI/UIController.h +++ b/Minecraft.Client/Common/UI/UIController.h @@ -15,7 +15,7 @@ class UIControl; class UIController : public IUIController { public: - static int64_t iggyAllocCount; + static __int64 iggyAllocCount; // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded static CRITICAL_SECTION ms_reloadSkinCS; @@ -29,7 +29,7 @@ private: CRITICAL_SECTION m_navigationLock; static const int UI_REPEAT_KEY_DELAY_MS = 300; // How long from press until the first repeat - static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats + static const int UI_REPEAT_KEY_REPEAT_RATE_MS = 100; // How long in between repeats DWORD m_actionRepeatTimer[XUSER_MAX_COUNT][ACTION_MAX_MENU+1]; float m_fScreenWidth; @@ -45,7 +45,7 @@ private: // 4J-PB - ui element type for PSVita touch control #ifdef __PSVITA__ - typedef struct + typedef struct { UIControl *pControl; S32 x1,y1,x2,y2; @@ -110,7 +110,7 @@ private: C4JRender::eViewportType m_currentRenderViewport; bool m_bCustomRenderPosition; - + static DWORD m_dwTrialTimerLimitSecs; unordered_map m_substitutionTextures; @@ -118,7 +118,7 @@ private: typedef struct _CachedMovieData { byteArray m_ba; - int64_t m_expiry; + __int64 m_expiry; } CachedMovieData; unordered_map m_cachedMovieData; @@ -179,7 +179,7 @@ protected: void postInit(); -public: +public: CRITICAL_SECTION m_Allocatorlock; void SetupFont(); public: @@ -208,7 +208,7 @@ private: void tickInput(); void handleInput(); void handleKeyPress(unsigned int iPad, unsigned int key); - + protected: static rrbool RADLINK ExternalFunctionCallback( void * user_callback_data , Iggy * player , IggyExternalFunctionCallUTF16 * call ); @@ -278,7 +278,7 @@ private: public: void CloseAllPlayersScenes(); void CloseUIScenes(int iPad, bool forceIPad = false); - + virtual bool IsPauseMenuDisplayed(int iPad); virtual bool IsContainerMenuDisplayed(int iPad); virtual bool IsIgnorePlayerJoinMenuDisplayed(int iPad); diff --git a/Minecraft.Client/Common/UI/UIGroup.cpp b/Minecraft.Client/Common/UI/UIGroup.cpp index ed9d06b1..1899d05b 100644 --- a/Minecraft.Client/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Common/UI/UIGroup.cpp @@ -81,7 +81,7 @@ void UIGroup::tick() } // Handle deferred update focus - if (m_updateFocusStateCountdown > 0) + if (m_updateFocusStateCountdown > 0) { m_updateFocusStateCountdown--; if (m_updateFocusStateCountdown == 0)_UpdateFocusState(); @@ -233,7 +233,7 @@ void UIGroup::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel } } -// FOCUS +// FOCUS // Check that a layer may recieve focus, specifically that there is no infocus layer above bool UIGroup::RequestFocus(UILayer* layerPtr) @@ -379,16 +379,16 @@ unsigned int UIGroup::GetLayerIndex(UILayer* layerPtr) // can't get here... return 0; } - -void UIGroup::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) + +void UIGroup::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) { - int64_t groupStatic = 0; - int64_t groupDynamic = 0; + __int64 groupStatic = 0; + __int64 groupDynamic = 0; app.DebugPrintf(app.USER_SR, "-- BEGIN GROUP %d\n",m_group); for(unsigned int i = 0; i < eUILayer_COUNT; ++i) { app.DebugPrintf(app.USER_SR, " \\- BEGIN LAYER %d\n",i); - m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic); + m_layers[i]->PrintTotalMemoryUsage(groupStatic, groupDynamic); app.DebugPrintf(app.USER_SR, " \\- END LAYER %d\n",i); } app.DebugPrintf(app.USER_SR, "-- Group static: %d, Group dynamic: %d\n", groupStatic, groupDynamic); @@ -402,7 +402,7 @@ int UIGroup::getCommandBufferList() return m_commandBufferList; } -// Returns the first scene of given type if it exists, NULL otherwise +// Returns the first scene of given type if it exists, NULL otherwise UIScene *UIGroup::FindScene(EUIScene sceneType) { UIScene *pScene = NULL; diff --git a/Minecraft.Client/Common/UI/UIGroup.h b/Minecraft.Client/Common/UI/UIGroup.h index 8e16c2c3..e20fbb02 100644 --- a/Minecraft.Client/Common/UI/UIGroup.h +++ b/Minecraft.Client/Common/UI/UIGroup.h @@ -19,10 +19,10 @@ private: UIScene_HUD *m_hud; C4JRender::eViewportType m_viewportType; - + EUIGroup m_group; int m_iPad; - + bool m_bMenuDisplayed; bool m_bPauseMenuDisplayed; bool m_bContainerMenuDisplayed; @@ -90,7 +90,7 @@ public: void SetViewportType(C4JRender::eViewportType type); C4JRender::eViewportType GetViewportType(); - + virtual void HandleDLCMountingComplete(); virtual void HandleDLCInstalled(); #ifdef _XBOX_ONE @@ -99,15 +99,15 @@ public: bool IsFullscreenGroup(); void handleUnlockFullVersion(); - - void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); + + void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); unsigned int GetLayerIndex(UILayer* layerPtr); int getCommandBufferList(); UIScene *FindScene(EUIScene sceneType); -private: +private: void _UpdateFocusState(); void updateStackStates(); }; diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index 6acfc85f..15bde2fa 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -38,7 +38,7 @@ void UILayer::tick() m_scenesToDelete.push_back(scene); } } - + while (!m_scenesToDestroy.empty()) { UIScene *scene = m_scenesToDestroy.back(); @@ -46,13 +46,13 @@ void UILayer::tick() scene->destroyMovie(); } m_scenesToDestroy.clear(); - + for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it) { (*it)->tick(); } // Note: reverse iterator, the last element is the top of the stack - int sceneIndex = m_sceneStack.size() - 1; + int sceneIndex = m_sceneStack.size() - 1; //for(AUTO_VAR(it,m_sceneStack.rbegin()); it != m_sceneStack.rend(); ++it) while( sceneIndex >= 0 && sceneIndex < m_sceneStack.size() ) { @@ -422,9 +422,9 @@ bool UILayer::NavigateToScene(int iPad, EUIScene scene, void *initData) } m_sceneStack.push_back(newScene); - + updateFocusState(); - + newScene->tick(); return true; @@ -706,12 +706,12 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) // 4J-PB - this should just be true m_bMenuDisplayed=true; - + EUIScene sceneType = scene->getSceneType(); switch(sceneType) { case eUIScene_PauseMenu: - m_bPauseMenuDisplayed = true; + m_bPauseMenuDisplayed = true; break; case eUIScene_Crafting2x2Menu: case eUIScene_Crafting3x3Menu: @@ -727,7 +727,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) // Intentional fall-through case eUIScene_DeathMenu: - case eUIScene_FullscreenProgress: + case eUIScene_FullscreenProgress: case eUIScene_SignEntryMenu: case eUIScene_EndPoem: m_bIgnoreAutosaveMenuDisplayed = true; @@ -736,7 +736,7 @@ bool UILayer::updateFocusState(bool allowedFocus /* = false */) switch(sceneType) { - case eUIScene_FullscreenProgress: + case eUIScene_FullscreenProgress: case eUIScene_EndPoem: case eUIScene_Credits: case eUIScene_LeaderboardsMenu: @@ -775,8 +775,8 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel UIScene *scene = *it; if(scene->hasFocus(iPad) && scene->canHandleInput()) { - // 4J-PB - ignore repeats of action ABXY buttons - // fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt. + // 4J-PB - ignore repeats of action ABXY buttons + // fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt. // 4J Stu - Changed this slightly to add the allowRepeat function so we can allow repeats in the crafting menu if(repeat && !scene->allowRepeat(key) ) { @@ -784,8 +784,8 @@ void UILayer::handleInput(int iPad, int key, bool repeat, bool pressed, bool rel } scene->handleInput(iPad, key, repeat, pressed, released, handled); } - - // Fix for PS3 #444 - [IN GAME] If the user keeps pressing CROSS while on the 'Save Game' screen the title will crash. + + // Fix for PS3 #444 - [IN GAME] If the user keeps pressing CROSS while on the 'Save Game' screen the title will crash. handled = handled || scene->hidesLowerScenes(); if(handled ) break; } @@ -842,10 +842,10 @@ void UILayer::handleUnlockFullVersion() } } -void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) +void UILayer::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) { - int64_t layerStatic = 0; - int64_t layerDynamic = 0; + __int64 layerStatic = 0; + __int64 layerDynamic = 0; for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it) { (*it)->PrintTotalMemoryUsage(layerStatic, layerDynamic); @@ -859,7 +859,7 @@ void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) totalDynamic += layerDynamic; } -// Returns the first scene of given type if it exists, NULL otherwise +// Returns the first scene of given type if it exists, NULL otherwise UIScene *UILayer::FindScene(EUIScene sceneType) { for (int i = 0; i < m_sceneStack.size(); i++) diff --git a/Minecraft.Client/Common/UI/UILayer.h b/Minecraft.Client/Common/UI/UILayer.h index 357c2874..2840f23f 100644 --- a/Minecraft.Client/Common/UI/UILayer.h +++ b/Minecraft.Client/Common/UI/UILayer.h @@ -66,12 +66,12 @@ public: // INPUT void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); -#ifdef __PSVITA__ +#ifdef __PSVITA__ // Current active scene UIScene *getCurrentScene(); #endif // FOCUS - + bool updateFocusState(bool allowedFocus = false); public: @@ -85,7 +85,7 @@ public: #endif void handleUnlockFullVersion(); UIScene *FindScene(EUIScene sceneType); - - void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); + + void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); }; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 75eb3dcf..e7d907ec 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -13,7 +13,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer) m_iPad = iPad; swf = NULL; m_pItemRenderer = NULL; - + bHasFocus = false; m_hasTickedOnce = false; m_bFocussedOnce = false; @@ -27,7 +27,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer) m_bUpdateOpacity = false; m_backScene = NULL; - + m_cacheSlotRenders = false; m_needsCacheRendered = true; m_expectedCachedSlotCount = 0; @@ -94,7 +94,7 @@ void UIScene::reloadMovie(bool force) } handleReload(); - + IggyDataValue result; IggyDataValue value[1]; @@ -328,11 +328,11 @@ void UIScene::loadMovie() } byteArray baFile = ui.getMovieData(moviePath.c_str()); - int64_t beforeLoad = ui.iggyAllocCount; + __int64 beforeLoad = ui.iggyAllocCount; swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL); - int64_t afterLoad = ui.iggyAllocCount; - IggyPlayerInitializeAndTickRS ( swf ); - int64_t afterTick = ui.iggyAllocCount; + __int64 afterLoad = ui.iggyAllocCount; + IggyPlayerInitializeAndTickRS ( swf ); + __int64 afterTick = ui.iggyAllocCount; if(!swf) { @@ -343,7 +343,7 @@ void UIScene::loadMovie() app.FatalLoadError(); } app.DebugPrintf( app.USER_SR, "Loaded iggy movie %ls\n", moviePath.c_str() ); - IggyProperties *properties = IggyPlayerProperties ( swf ); + IggyProperties *properties = IggyPlayerProperties ( swf ); m_movieHeight = properties->movie_height_in_pixels; m_movieWidth = properties->movie_width_in_pixels; @@ -351,7 +351,7 @@ void UIScene::loadMovie() m_renderHeight = m_movieHeight; S32 width, height; - m_parentLayer->getRenderDimensions(width, height); + m_parentLayer->getRenderDimensions(width, height); IggyPlayerSetDisplaySize( swf, width, height ); IggyPlayerSetUserdata(swf,this); @@ -361,8 +361,8 @@ void UIScene::loadMovie() IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - int64_t totalStatic = 0; - int64_t totalDynamic = 0; + __int64 totalStatic = 0; + __int64 totalDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , 0 , @@ -372,7 +372,7 @@ void UIScene::loadMovie() { totalStatic += memoryInfo.static_allocation_bytes; totalDynamic += memoryInfo.dynamic_allocation_bytes; - app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), memoryInfo.subcategory_stringlen, memoryInfo.subcategory, + app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), memoryInfo.subcategory_stringlen, memoryInfo.subcategory, memoryInfo.static_allocation_bytes, memoryInfo.static_allocation_count, memoryInfo.dynamic_allocation_bytes, memoryInfo.dynamic_allocation_count); ++iteration; //if(memoryInfo.static_allocation_bytes > 0) getDebugMemoryUseRecursive(moviePath, memoryInfo); @@ -398,22 +398,22 @@ void UIScene::getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUse internalIteration , &internalMemoryInfo )) { - app.DebugPrintf(app.USER_SR, "%ls - %.*s static: %d ( %d ) dynamic: %d ( %d )\n", moviePath.c_str(), internalMemoryInfo.subcategory_stringlen, internalMemoryInfo.subcategory, + 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); ++internalIteration; if(internalMemoryInfo.subcategory_stringlen > memoryInfo.subcategory_stringlen) getDebugMemoryUseRecursive(moviePath, internalMemoryInfo); } } -void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) +void UIScene::PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic) { if(!swf) return; IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - int64_t sceneStatic = 0; - int64_t sceneDynamic = 0; + __int64 sceneStatic = 0; + __int64 sceneDynamic = 0; while(res = IggyDebugGetMemoryUseInfo ( swf , NULL , "" , @@ -483,7 +483,7 @@ void UIScene::tickTimers() { it = m_timers.erase(it); } - else + else { if(currentTime > it->second.targetTime) { @@ -634,7 +634,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP if(useCommandBuffers) RenderManager.CBuffStart(list, true); #endif PIXBeginNamedEvent(0,"Draw uncached"); - ui.setupCustomDrawMatrices(this, customDrawRegion); + ui.setupCustomDrawMatrices(this, customDrawRegion); _customDrawSlotControl(customDrawRegion, iPad, item, fAlpha, isFoil, bDecorations, useCommandBuffers); delete customDrawRegion; PIXEndNamedEvent(); @@ -644,7 +644,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP for(AUTO_VAR(it, m_cachedSlotDraw.begin()); it != m_cachedSlotDraw.end(); ++it) { CachedSlotDrawData *drawData = *it; - ui.setupCustomDrawMatrices(this, drawData->customDrawRegion); + ui.setupCustomDrawMatrices(this, drawData->customDrawRegion); _customDrawSlotControl(drawData->customDrawRegion, iPad, drawData->item, drawData->fAlpha, drawData->isFoil, drawData->bDecorations, useCommandBuffers); delete drawData->customDrawRegion; delete drawData; @@ -698,7 +698,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP // Finish GDraw and anything else that needs to be finalised ui.endCustomDraw(region); } - } + } } void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer) @@ -716,7 +716,7 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt // we might want separate x & y scales here float scaleX = bwidth / 16.0f; - float scaleY = bheight / 16.0f; + float scaleY = bheight / 16.0f; glEnable(GL_RESCALE_NORMAL); glPushMatrix(); @@ -751,8 +751,8 @@ void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_pt if(bDecorations) { if((scaleX!=1.0f) ||(scaleY!=1.0f)) - { - glPushMatrix(); + { + glPushMatrix(); glScalef(scaleX, scaleY, 1.0f); int iX= (int)(0.5f+((float)x)/scaleX); int iY= (int)(0.5f+((float)y)/scaleY); @@ -975,8 +975,8 @@ int UIScene::convertGameActionToIggyKeycode(int action) bool UIScene::allowRepeat(int key) { - // 4J-PB - ignore repeats of action ABXY buttons - // fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt. + // 4J-PB - ignore repeats of action ABXY buttons + // fix for PS3 213 - [MAIN MENU] Holding down buttons will continue to activate every prompt. switch(key) { case ACTION_MENU_OK: diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index 1b646ce0..823c510c 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -40,7 +40,7 @@ class UILayer; class UIScene { friend class UILayer; -public: +public: IggyValuePath *m_rootPath; private: @@ -80,7 +80,7 @@ public: protected: ESceneResolution m_loadedResolution; - + bool m_bIsReloading; bool m_bFocussedOnce; @@ -96,7 +96,7 @@ protected: public: virtual Iggy *getMovie() { return swf; } - + void destroyMovie(); virtual void reloadMovie(bool force = false); virtual bool needsReloaded(); @@ -127,7 +127,7 @@ private: void getDebugMemoryUseRecursive(const wstring &moviePath, IggyMemoryUseInfo &memoryInfo); public: - void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); + void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); public: UIScene(int iPad, UILayer *parentLayer); @@ -140,7 +140,7 @@ public: IggyName registerFastName(const wstring &name); #ifdef __PSVITA__ - void SetFocusToElement(int iID); + void SetFocusToElement(int iID); void UpdateSceneControls(); #endif protected: @@ -160,7 +160,7 @@ public: void gainFocus(); void loseFocus(); - + virtual void updateTooltips(); virtual void updateComponents() {} virtual void handleGainFocus(bool navBack); @@ -188,7 +188,7 @@ public: protected: //void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, int iID, int iCount, int iAuxVal, float fAlpha, bool isFoil, bool bDecorations); void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr item, float fAlpha, bool isFoil, bool bDecorations); - + bool m_cacheSlotRenders; bool m_needsCacheRendered; int m_expectedCachedSlotCount; @@ -260,7 +260,7 @@ public: protected: -#ifdef _DURANGO +#ifdef _DURANGO virtual long long getDefaultGtcButtons() { return _360_GTC_BACK; } #endif diff --git a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp index 0c415c7b..6be67bed 100644 --- a/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_CreateWorldMenu.cpp @@ -61,11 +61,11 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_labelTexturePackDescription.init(L""); WCHAR TempString[256]; - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[app.GetGameSettings(m_iPad,eGameSetting_Difficulty)])); m_sliderDifficulty.init(TempString,eControl_Difficulty,0,3,app.GetGameSettings(m_iPad,eGameSetting_Difficulty)); m_MoreOptionsParams.bGenerateOptions=TRUE; - m_MoreOptionsParams.bStructures=TRUE; + m_MoreOptionsParams.bStructures=TRUE; m_MoreOptionsParams.bFlatWorld=FALSE; m_MoreOptionsParams.bBonusChest=FALSE; m_MoreOptionsParams.bPVP = TRUE; @@ -85,7 +85,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay m_MoreOptionsParams.bOnlineSettingChangedBySystem=false; // 4J-PB - Removing this so that we can attempt to create an online game on PS3 when we are a restricted child account - // It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online, + // It'll fail when we choose create, but this matches the behaviour of load game, and lets the player know why they can't play online, // instead of just greying out the online setting in the More Options // #ifdef __PS3__ // if(ProfileManager.IsSignedInLive( m_iPad )) @@ -118,9 +118,9 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay { // The profile settings say Online, but either the player is offline, or they are not allowed to play online m_MoreOptionsParams.bOnlineSettingChangedBySystem=true; - } + } } - + #if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64 if(getSceneResolution() == eSceneResolution_1080) { @@ -339,7 +339,7 @@ int UIScene_CreateWorldMenu::ContinueOffline(void *pParam,int iPad,C4JStorage::E UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { pClass->m_MoreOptionsParams.bOnlineGame=false; pClass->checkStateAndStartGame(); @@ -374,7 +374,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p if ( pressed && controlHasFocus(m_checkboxOnline.getId()) && !m_checkboxOnline.IsEnabled() ) { UINT uiIDA[1] = { IDS_CONFIRM_OK }; - ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); + ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } #endif @@ -385,7 +385,7 @@ void UIScene_CreateWorldMenu::handleInput(int iPad, int key, bool repeat, bool p case ACTION_MENU_OTHER_STICK_UP: case ACTION_MENU_OTHER_STICK_DOWN: sendInputToMovie(key, repeat, pressed, released); - + #if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64 if(getSceneResolution() == eSceneResolution_1080) { @@ -557,7 +557,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() if(m_MoreOptionsParams.dwTexturePack!=0) { // texture pack hasn't been set yet, so check what it will be - TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); + TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack; m_pDLCPack=pDLCTexPack->getDLCInfoParentPack(); @@ -609,7 +609,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow() UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; - ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); + ui.RequestMessageBox(IDS_WARNING_DLC_TRIALTEXTUREPACK_TITLE, IDS_USING_TRIAL_TEXUREPACK_WARNING, uiIDA, 2, m_iPad,&TrialTexturePackWarningReturned,this,app.GetStringTable(),NULL,0,false); #endif #if defined _XBOX_ONE || defined __ORBIS__ @@ -636,7 +636,7 @@ void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue) m_sliderDifficulty.handleSliderMove(value); app.SetGameSettings(m_iPad,eGameSetting_Difficulty,value); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[value])); m_sliderDifficulty.setLabel(TempString); break; } @@ -683,7 +683,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) m_MoreOptionsParams.bInviteOnly = FALSE; m_MoreOptionsParams.bAllowFriendsOfFriends = FALSE; } - + #if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64 if(getSceneResolution() == eSceneResolution_1080) { @@ -721,7 +721,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id) PBYTE pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; ListInfo.iData = m_iConfigA[i]; HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); @@ -803,7 +803,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() bool isOnlineGame = m_MoreOptionsParams.bOnlineGame; int iPadNotSignedInLive = -1; bool isLocalMultiplayerAvailable = app.IsLocalMultiplayerAvailable(); - + for(unsigned int i = 0; i < XUSER_MAX_COUNT; i++) { if (ProfileManager.IsSignedIn(i) && (i == primaryPad || isLocalMultiplayerAvailable)) @@ -855,7 +855,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() ui.RequestMessageBox(IDS_PRO_CURRENTLY_NOT_ONLINE_TITLE, IDS_PRO_PSNOFFLINE_TEXT, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL,NULL, app.GetStringTable()); } else - { + { // Not signed in to PSN UINT uiIDA[1]; uiIDA[0] = IDS_CONFIRM_OK; @@ -901,7 +901,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -916,7 +916,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() #endif if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE) - { + { UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -980,7 +980,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -1033,8 +1033,8 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame() SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; - param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -1107,13 +1107,13 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE); - int64_t seedValue = 0; + __int64 seedValue = 0; NetworkGameInitData *param = new NetworkGameInitData(); if (wSeed.length() != 0) { - int64_t value = 0; + __int64 value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -1132,7 +1132,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString(wSeed); + value = _fromString<__int64>(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -1336,7 +1336,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu } } else - { + { pClass->m_bIgnoreInput = false; } return 0; @@ -1347,7 +1347,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor { UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; @@ -1392,7 +1392,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_USER_CREATED_CONTENT_PRIVILEGE_CREATE, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable(),NULL,0,false); } else - { + { #if defined( __ORBIS__) || defined(__PSVITA__) bool isOnlineGame = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; if(isOnlineGame) @@ -1422,7 +1422,7 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu *)pParam; pClass->m_bIgnoreInput = false; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { SQRNetworkManager_Orbis::AttemptPSNSignIn(&UIScene_CreateWorldMenu::StartGame_SignInReturned, pClass, false, iPad); } @@ -1434,28 +1434,28 @@ int UIScene_CreateWorldMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStor // { // int32_t iResult; // UIScene_CreateWorldMenu *pClass = (UIScene_CreateWorldMenu *)pParam; -// +// // // continue offline, or upsell PS Plus? -// if(result==C4JStorage::EMessage_ResultDecline) +// if(result==C4JStorage::EMessage_ResultDecline) // { // // upsell psplus // int32_t iResult=sceNpCommerceDialogInitialize(); -// +// // SceNpCommerceDialogParam param; // sceNpCommerceDialogParamInitialize(¶m); // param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; -// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; +// param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; // param.userId = ProfileManager.getUserID(pClass->m_iPad); -// +// // iResult=sceNpCommerceDialogOpen(¶m); // } -// else if(result==C4JStorage::EMessage_ResultAccept) +// else if(result==C4JStorage::EMessage_ResultAccept) // { // // continue offline // pClass->m_MoreOptionsParams.bOnlineGame=false; // pClass->checkStateAndStartGame(); // } -// +// // pClass->m_bIgnoreInput=false; // return 0; // } diff --git a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h index c3e0ca1c..e45fa09c 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LoadMenu.h @@ -16,13 +16,13 @@ private: }; static int m_iDifficultyTitleSettingA[4]; - + UIControl m_controlMainPanel; UIControl_Label m_labelGameName, m_labelSeed, m_labelCreatedMode; UIControl_Button m_buttonGamemode, m_buttonMoreOptions, m_buttonLoadWorld; UIControl_Slider m_sliderDifficulty; UIControl_BitmapIcon m_bitmapIcon; - + #if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64 UIControl_CheckBox m_checkboxOnline; #endif @@ -35,7 +35,7 @@ private: UI_MAP_ELEMENT( m_labelSeed, "Seed") UI_MAP_ELEMENT( m_texturePackList, "TexturePackSelector") UI_MAP_ELEMENT( m_buttonGamemode, "GameModeToggle") - + #if defined _XBOX_ONE || defined __ORBIS__ || defined _WINDOWS64 UI_MAP_ELEMENT( m_checkboxOnline, "CheckboxOnline") #endif @@ -48,7 +48,7 @@ private: LevelGenerationOptions *m_levelGen; DLCPack * m_pDLCPack; - + int m_iSaveGameInfoIndex; int m_CurrentDifficulty; bool m_bGameModeSurvival; @@ -61,7 +61,7 @@ private: bool m_bRequestQuadrantSignin; bool m_bIsCorrupt; bool m_bThumbnailGetFailed; - int64_t m_seed; + __int64 m_seed; #ifdef __PS3__ std::vector*m_pvProductInfo; @@ -75,7 +75,7 @@ private: bool m_bRebuildTouchBoxes; public: UIScene_LoadMenu(int iPad, void *initData, UILayer *parentLayer); - + virtual void updateTooltips(); virtual void updateComponents(); @@ -110,7 +110,7 @@ private: #ifdef _DURANGO static void checkPrivilegeCallback(LPVOID lpParam, bool hasPrivilege, int iPad); #endif - + static int ConfirmLoadReturned(void *pParam,int iPad,C4JStorage::EMessageResult result); static void StartGameFromSave(UIScene_LoadMenu* pClass, DWORD dwLocalUsersMask); static int LoadSaveDataReturned(void *pParam,bool bIsCorrupt, bool bIsOwner); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 166c708d..1d90da77 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -207,7 +207,7 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer bool bTexturePackAlreadyListed; bool bNeedToGetTPD=false; Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); for(unsigned int i = 0; i < app.GetDLCInfoTexturesOffersCount(); ++i) { @@ -311,7 +311,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() // update the tooltips // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should the the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; int iLB = -1; int iX=-1; @@ -322,7 +322,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() else if (DoesSavesListHaveFocus()) { if((m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC)) - { + { if(StorageManager.GetSaveDisabled()) { iRB=IDS_TOOLTIPS_DELETESAVE; @@ -378,7 +378,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() // Is there a save from PS3 or PSVita available? // Sony asked that this be displayed at all times so users are aware of the functionality. We'll display some text when there's no save available //if(app.getRemoteStorage()->saveIsAvailable()) - { + { bool bSignedInLive = ProfileManager.IsSignedInLive(m_iPad); if(bSignedInLive) { @@ -393,7 +393,7 @@ void UIScene_LoadOrJoinMenu::updateTooltips() ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK, iX, iY,-1,-1,iLB,iRB); } -// +// void UIScene_LoadOrJoinMenu::Initialise() { m_iSaveListIndex = 0; @@ -481,7 +481,7 @@ void UIScene_LoadOrJoinMenu::handleGainFocus(bool navBack) { app.SetLiveLinkRequired( true ); - m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); + m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); // re-enable button presses m_bIgnoreInput=false; @@ -825,7 +825,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() m_pSaveDetails=StorageManager.ReturnSavesInfo(); if(m_pSaveDetails==NULL) { - C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); + C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); } #endif @@ -874,7 +874,7 @@ void UIScene_LoadOrJoinMenu::GetSaveInfo() m_pSaveDetails=StorageManager.ReturnSavesInfo(); if(m_pSaveDetails==NULL) { - C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); + C4JStorage::ESaveGameState eSGIStatus= StorageManager.GetSavesInfo(m_iPad,NULL,this,"save"); } #if TO_BE_IMPLEMENTED @@ -918,7 +918,7 @@ void UIScene_LoadOrJoinMenu::AddDefaultButtons() continue; } } - + m_generators.push_back(levelGen); m_buttonListSaves.addItem(levelGen->getWorldName()); @@ -969,7 +969,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr case ACTION_MENU_X: #if TO_BE_IMPLEMENTED // Change device - // Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage + // Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage // device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes. m_bIgnoreInput=true; StorageManager.SetSaveDevice(&CScene_MultiGameJoinLoad::DeviceSelectReturned,this,true); @@ -987,7 +987,7 @@ void UIScene_LoadOrJoinMenu::handleInput(int iPad, int key, bool repeat, bool pr { bool bSignedInLive = ProfileManager.IsSignedInLive(iPad); if(bSignedInLive) - { + { LaunchSaveTransfer(); } } @@ -1171,7 +1171,7 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo UIScene_LoadOrJoinMenu *pClass=(UIScene_LoadOrJoinMenu *)lpParam; pClass->m_bIgnoreInput=false; if (bRes) - { + { uint16_t ui16Text[128]; ZeroMemory(ui16Text, 128 * sizeof(uint16_t) ); InputManager.GetText(ui16Text); @@ -1184,13 +1184,13 @@ int UIScene_LoadOrJoinMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,boo StorageManager.RenameSaveData(pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC, ui16Text,&UIScene_LoadOrJoinMenu::RenameSaveDataReturned,pClass); #endif } - else + else { pClass->m_bIgnoreInput=false; pClass->updateTooltips(); } - } - else + } + else { pClass->m_bIgnoreInput=false; pClass->updateTooltips(); @@ -1204,13 +1204,13 @@ void UIScene_LoadOrJoinMenu::handleInitFocus(F64 controlId, F64 childId) app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleInitFocus - %d , %d\n", (int)controlId, (int)childId); } -void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId) +void UIScene_LoadOrJoinMenu::handleFocusChange(F64 controlId, F64 childId) { app.DebugPrintf(app.USER_SR, "UIScene_LoadOrJoinMenu::handleFocusChange - %d , %d\n", (int)controlId, (int)childId); - + switch((int)controlId) { - case eControl_GamesList: + case eControl_GamesList: m_iGameListIndex = childId; m_buttonListGames.updateChildFocus( (int) childId ); break; @@ -1246,7 +1246,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) ui.PlayUISFX(eSFX_Press); if((int)childId == JOIN_LOAD_CREATE_BUTTON_INDEX) - { + { app.SetTutorialMode( false ); m_controlJoinTimer.setVisible( false ); @@ -1298,7 +1298,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) } else #endif - { + { app.SetTutorialMode( false ); if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) @@ -1340,7 +1340,7 @@ void UIScene_LoadOrJoinMenu::handlePress(F64 controlId, F64 childId) case eControl_GamesList: { m_bIgnoreInput=true; - + m_eAction = eAction_JoinGame; //CD - Added for audio @@ -1375,7 +1375,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) bool bPlayStationPlus=true; int iPadWithNoPlaystationPlus=0; - bool isSignedInLive = true; + bool isSignedInLive = true; int iPadNotSignedInLive = -1; for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i) { @@ -1458,7 +1458,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) SceNpCommerceDialogParam param; sceNpCommerceDialogParamInitialize(¶m); param.mode=SCE_NP_COMMERCE_DIALOG_MODE_PLUS; - param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; + param.features = SCE_NP_PLUS_FEATURE_REALTIME_MULTIPLAY; param.userId = ProfileManager.getUserID(iPadWithNoPlaystationPlus); iResult=sceNpCommerceDialogOpen(¶m); @@ -1532,7 +1532,7 @@ void UIScene_LoadOrJoinMenu::CheckAndJoinGame(int gameIndex) } void UIScene_LoadOrJoinMenu::LoadLevelGen(LevelGenerationOptions *levelGen) -{ +{ // Load data from disc //File saveFile( L"Tutorial\\Tutorial" ); //LoadSaveFromDisk(&saveFile); @@ -1630,7 +1630,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should show the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; int iX=-1; @@ -1854,7 +1854,7 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id) if(iImageDataBytes!=0) { - // set the image + // set the image registerSubstitutionTexture(textureName,pbImageData,iImageDataBytes,true); m_iConfigA[i]=-1; } @@ -1867,7 +1867,7 @@ void UIScene_LoadOrJoinMenu::handleTimerComplete(int id) bool bAllDone=true; for(int i=0;igetName().c_str()); - int64_t fileSize = saveFile->length(); + __int64 fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); @@ -1946,7 +1946,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromDisk(File *saveFile, ESavePlatform save #ifdef SONY_REMOTE_STORAGE_DOWNLOAD void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() -{ +{ wchar_t wFileName[128]; mbstowcs(wFileName, app.getRemoteStorage()->getLocalFilename(), strlen(app.getRemoteStorage()->getLocalFilename())+1); // plus null @@ -1960,7 +1960,7 @@ void UIScene_LoadOrJoinMenu::LoadSaveFromCloud() mbstowcs(wSaveName, app.getRemoteStorage()->getSaveNameUTF8(), strlen(app.getRemoteStorage()->getSaveNameUTF8())+1); // plus null StorageManager.SetSaveTitle(wSaveName); - int64_t fileSize = cloudFile.length(); + __int64 fileSize = cloudFile.length(); FileInputStream fis(cloudFile); byteArray ba(fileSize); fis.read(ba); @@ -2019,7 +2019,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDialogReturned(void *pParam,int iPad,C4JSt // Check that we have a valid save selected (can get a bad index if the save list has been refreshed) bool validSelection= pClass->m_iDefaultButtonsC != 0 && pClass->m_iSaveListIndex >= pClass->m_iDefaultButtonsC; - if(result==C4JStorage::EMessage_ResultDecline && validSelection) + if(result==C4JStorage::EMessage_ResultDecline && validSelection) { if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) { @@ -2049,7 +2049,7 @@ int UIScene_LoadOrJoinMenu::DeleteSaveDataReturned(LPVOID lpParam,bool bRes) if(bRes) { // wipe the list and repopulate it - pClass->m_iState=e_SavesRepopulateAfterDelete; + pClass->m_iState=e_SavesRepopulateAfterDelete; } else pClass->m_bIgnoreInput=false; @@ -2169,7 +2169,7 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS UIScene_LoadOrJoinMenu *pClass = (UIScene_LoadOrJoinMenu *)pParam; // Exit with or without saving - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -2194,9 +2194,9 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS #endif -#if defined _XBOX_ONE +#if defined _XBOX_ONE if(ProfileManager.IsSignedIn(iPad)) - { + { if (ProfileManager.IsSignedInLive(iPad)) { wstring ProductId; @@ -2205,13 +2205,13 @@ int UIScene_LoadOrJoinMenu::TexturePackDialogReturned(void *pParam,int iPad,C4JS StorageManager.InstallOffer(1,(WCHAR *)ProductId.c_str(),NULL,NULL); } else - { + { // 4J-JEV: Fix for XB1: #165863 - XR-074: Compliance: With no active network connection user is unable to convert from Trial to Full texture pack and is not messaged why. UINT uiIDA[1] = { IDS_CONFIRM_OK }; - ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); + ui.RequestMessageBox(IDS_PRO_NOTONLINE_TITLE, IDS_PRO_XBOXLIVE_NOTIFICATION, uiIDA, 1, iPad, NULL, NULL, app.GetStringTable()); } } -#endif +#endif } pClass->m_bIgnoreInput=false; @@ -2223,7 +2223,7 @@ int UIScene_LoadOrJoinMenu::MustSignInReturnedPSN(void *pParam,int iPad,C4JStora { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { #if defined(__PS3__) SQRNetworkManager_PS3::AttemptPSNSignIn(&UIScene_LoadOrJoinMenu::PSN_SignInReturned, pClass); @@ -2442,7 +2442,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter DWORD dwDataSizeSaveImage=0; StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t - StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that + StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that BYTE bTextMetadata[88]; ZeroMemory(bTextMetadata,88); @@ -2470,7 +2470,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter { // we can't cancel here, we need the saves info so we can delete the file if(pClass->m_saveTransferDownloadCancelled) - { + { WCHAR wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; @@ -2485,7 +2485,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter break; case eSaveTransfer_GettingSavesInfo: if(pClass->m_saveTransferDownloadCancelled) - { + { WCHAR wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; @@ -2602,7 +2602,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter DWORD dwDataSizeSaveImage=0; StorageManager.GetDefaultSaveImage(&pbDataSaveImage, &dwDataSizeSaveImage); // Get the default save thumbnail (as set by SetDefaultImages) for use on saving games t - StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that + StorageManager.GetDefaultSaveThumbnail(&pbThumbnailData,&dwThumbnailDataSize); // Get the default save image (as set by SetDefaultImages) for use on saving games that BYTE bTextMetadata[88]; ZeroMemory(bTextMetadata,88); @@ -2613,12 +2613,12 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter } -#ifdef SPLIT_SAVES +#ifdef SPLIT_SAVES ConsoleSaveFileOriginal oldFormatSave( wSaveName, ba.data, ba.length, false, app.getRemoteStorage()->getSavePlatform() ); pSave = new ConsoleSaveFileSplit( &oldFormatSave, false, pMinecraft->progressRenderer ); pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING); - pSave->Flush(false,false); + pSave->Flush(false,false); pClass->m_eSaveTransferState = eSaveTransfer_Saving; #else pSave = new ConsoleSaveFileOriginal( wSaveName, ba.data, ba.length, false, app.getRemoteStorage()->getSavePlatform() ); @@ -2654,7 +2654,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter delete pSave; - + pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC); pClass->m_eSaveTransferState = eSaveTransfer_Succeeded; } @@ -2668,7 +2668,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; app.getRemoteStorage()->waitForStorageManagerIdle(); // wait for everything to complete before we hand control back to the player - ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); + ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveTransferState = eSaveTransfer_Finished; } break; @@ -2683,7 +2683,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter if(bSaveFileCreated) { if(pClass->m_saveTransferDownloadCancelled) - { + { WCHAR wcTemp[256]; swprintf(wcTemp,256, app.GetString(IDS_CANCEL)); // MGH - should change this string to "cancelling download" m_wstrStageText=wcTemp; @@ -2743,7 +2743,7 @@ int UIScene_LoadOrJoinMenu::DownloadSonyCrossSaveThreadProc( LPVOID lpParameter { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); + ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_DOWNLOAD, IDS_SAVE_TRANSFER_DOWNLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveTransferState = eSaveTransfer_Finished; } if(bSaveFileCreated) // save file has been created, then deleted. @@ -2887,7 +2887,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); + ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADCOMPLETE, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveUploadState = esaveUpload_Finished; } break; @@ -2904,7 +2904,7 @@ int UIScene_LoadOrJoinMenu::UploadSonyCrossSaveThreadProc( LPVOID lpParameter ) { UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); + ui.RequestMessageBox( IDS_TOOLTIPS_SAVETRANSFER_UPLOAD, IDS_SAVE_TRANSFER_UPLOADFAILED, uiIDA,1,ProfileManager.GetPrimaryPad(),CrossSaveUploadFinishedCallback,pClass, app.GetStringTable()); pClass->m_eSaveUploadState = esaveUpload_Finished; } } @@ -2953,7 +2953,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferDialogReturned(void *pParam,int iPad,C4J { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { // upload the save pClass->LaunchSaveUpload(); @@ -3062,13 +3062,13 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) ByteArrayInputStream bais(UIScene_LoadOrJoinMenu::s_transferData); DataInputStream dis(&bais); - wstring saveTitle = dis.readUTF(); + wstring saveTitle = dis.readUTF(); StorageManager.SetSaveTitle(saveTitle.c_str()); wstring saveUniqueName = dis.readUTF(); // 4J Stu - Don't set this any more. We added it so that we could share the ban list data for this save - // However if the player downloads the same save multiple times, it will overwrite the previous version + // However if the player downloads the same save multiple times, it will overwrite the previous version // with that filname, and they could have made changes to it. //StorageManager.SetSaveUniqueFilename((wchar_t *)saveUniqueName.c_str()); @@ -3091,13 +3091,13 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) case eSaveTransferFile_SaveData: { #ifdef SPLIT_SAVES - if(!pStateContainer->m_bSaveTransferCancelled) + if(!pStateContainer->m_bSaveTransferCancelled) { ConsoleSaveFileOriginal oldFormatSave( L"Temp name", UIScene_LoadOrJoinMenu::s_transferData.data, UIScene_LoadOrJoinMenu::s_transferData.length, false, SAVE_FILE_PLATFORM_X360 ); pSave = new ConsoleSaveFileSplit( &oldFormatSave, false, pMinecraft->progressRenderer ); pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING); - if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false); + if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false); } pStateContainer->m_eSaveTransferState=C4JStorage::eSaveTransfer_Saving; @@ -3118,7 +3118,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) pSave->ConvertToLocalPlatform(); pMinecraft->progressRenderer->progressStage(IDS_SAVETRANSFER_STAGE_SAVING); - if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false); + if(!pStateContainer->m_bSaveTransferCancelled) pSave->Flush(false,false); pStateContainer->m_iProgress+=1; if(pStateContainer->m_iProgress==101) @@ -3134,8 +3134,8 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) // On Durango/Orbis, we need to wait for all the asynchronous saving processes to complete before destroying the levels, as that will ultimately delete // the directory level storage & therefore the ConsoleSaveSplit instance, which needs to be around until all the sub files have completed saving. #if defined(_DURANGO) || defined(__ORBIS__) - pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC); - + pMinecraft->progressRenderer->progressStage(IDS_PROGRESS_SAVING_TO_DISC); + while(StorageManager.GetSaveState() != C4JStorage::ESaveGame_Idle ) { Sleep(10); @@ -3150,9 +3150,9 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) #ifdef _XBOX_ONE pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_AND_CONVERT_COMPLETE); #endif - + pStateContainer->m_eSaveTransferState=C4JStorage::eSaveTransfer_Idle; - + // wipe the list and repopulate it if(!pStateContainer->m_bSaveTransferCancelled) pStateContainer->m_pClass->m_iState=e_SavesRepopulateAfterTransferDownload; @@ -3192,7 +3192,7 @@ int UIScene_LoadOrJoinMenu::DownloadXbox360SaveThreadProc( LPVOID lpParameter ) } void UIScene_LoadOrJoinMenu::RequestFileSize( SaveTransferStateContainer *pClass, wchar_t *filename ) -{ +{ Minecraft *pMinecraft=Minecraft::GetInstance(); // get the save file size @@ -3298,7 +3298,7 @@ int UIScene_LoadOrJoinMenu::SaveTransferUpdateProgress(LPVOID lpParam,unsigned l if(pClass->m_bSaveTransferCancelled) // was cancelled { - pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING); + pMinecraft->progressRenderer->progressStage(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING); swprintf(wcTemp,app.GetString(IDS_SAVE_TRANSFER_DOWNLOAD_CANCELLING)); m_wstrStageText=wcTemp; pMinecraft->progressRenderer->progressStage( m_wstrStageText ); @@ -3373,7 +3373,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDialogReturned(void *pParam,int iPad,C4JStor { UIScene_LoadOrJoinMenu* pClass = (UIScene_LoadOrJoinMenu*)pParam; - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { LoadingInputParams *loadingParams = new LoadingInputParams(); @@ -3418,7 +3418,7 @@ int UIScene_LoadOrJoinMenu::CopySaveThreadProc( LPVOID lpParameter ) ui.LeaveCallbackIdCriticalSection(); // Copy save data takes two callbacks - one for completion, and one for progress. The progress callback also lets us cancel the operation, if we return false. StorageManager.CopySaveData(&pClass->m_pSaveDetails->SaveInfoA[pClass->m_iSaveListIndex - pClass->m_iDefaultButtonsC],UIScene_LoadOrJoinMenu::CopySaveDataReturned,UIScene_LoadOrJoinMenu::CopySaveDataProgress,lpParameter); - + bool bContinue = true; do { @@ -3455,7 +3455,7 @@ int UIScene_LoadOrJoinMenu::CopySaveDataReturned(LPVOID lpParam, bool success, C { pClass->m_bCopying = false; // wipe the list and repopulate it - pClass->m_iState=e_SavesRepopulateAfterDelete; + pClass->m_iState=e_SavesRepopulateAfterDelete; ui.LeaveCallbackIdCriticalSection(); } else diff --git a/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp b/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp index b949aafa..b3608b06 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameCreate.cpp @@ -55,7 +55,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle CreateWorldMenuInitData *params = (CreateWorldMenuInitData *)pInitData->pvInitData; m_MoreOptionsParams.bGenerateOptions=TRUE; - m_MoreOptionsParams.bStructures=TRUE; + m_MoreOptionsParams.bStructures=TRUE; m_MoreOptionsParams.bFlatWorld=FALSE; m_MoreOptionsParams.bBonusChest=FALSE; m_MoreOptionsParams.bPVP = TRUE; @@ -96,7 +96,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle { // The profile settings say Online, but either the player is offline, or they are not allowed to play online m_MoreOptionsParams.bOnlineSettingChangedBySystem=true; - } + } } m_ButtonGameMode.SetText(app.GetString(IDS_GAMEMODE_SURVIVAL)); @@ -104,7 +104,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_CurrentDifficulty=app.GetGameSettings(m_iPad,eGameSetting_Difficulty); m_SliderDifficulty.SetValue(m_CurrentDifficulty); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[m_CurrentDifficulty])); m_SliderDifficulty.SetText(TempString); ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK); @@ -135,7 +135,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_NewWorld.SetEnable(true); m_EditWorldName.SetTextLimit(XCONTENT_MAX_DISPLAYNAME_LENGTH); - + wstring wWorldName = m_EditWorldName.GetText(); // set the caret to the end of the default text @@ -148,7 +148,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle XuiSetTimer(m_hObj,GAME_CREATE_ONLINE_TIMER_ID,GAME_CREATE_ONLINE_TIMER_TIME); XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME); - + TelemetryManager->RecordMenuShown(m_iPad, eUIScene_CreateWorldMenu, 0); // 4J-PB - Load up any texture pack data we have locally in the XZP @@ -176,7 +176,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; HRESULT hr; for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -189,7 +189,7 @@ HRESULT CScene_MultiGameCreate::OnInit( XUIMessageInit* pInitData, BOOL& bHandle if(dwImageBytes > 0 && pbImageData) { - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp; if(pDLCTexPack) { @@ -297,7 +297,7 @@ HRESULT CScene_MultiGameCreate::OnDestroy() app.RemoveMemoryTPDFile(app.TMSFileA[i].iConfig); } } - + app.FreeLocalTMSFiles(eTMSFileType_TexturePack); return S_OK; @@ -338,7 +338,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // DLC might have been corrupt if(ullOfferID_Full!=0LL) - { + { TelemetryManager->RecordUpsellPresented(ProfileManager.GetPrimaryPad(), eSet_UpsellID_Texture_DLC, ullOfferID_Full & 0xFFFFFFFF); UINT uiIDA[3]; @@ -374,7 +374,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr // if the profile data has been changed, then force a profile write (we save the online/invite/friends of friends settings) // It seems we're allowed to break the 5 minute rule if it's the result of a user action // check the checkboxes - + // Only save the online setting if the user changed it - we may change it because we're offline, but don't want that saved if(!m_MoreOptionsParams.bOnlineSettingChangedBySystem) { @@ -389,15 +389,15 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr if(m_MoreOptionsParams.dwTexturePack!=0) { // texture pack hasn't been set yet, so check what it will be - TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); - + TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack); + if(pTexturePack==NULL) { // corrupt DLC so set it to the default textures m_MoreOptionsParams.dwTexturePack=0; } else - { + { m_pDLCPack=pTexturePack->getDLCPack(); // do we have a license? if(m_pDLCPack && !m_pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) @@ -439,11 +439,11 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr return S_OK; } } - } + } } if(m_bGameModeSurvival != true || m_MoreOptionsParams.bHostPrivileges == TRUE) - { + { UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_OK; uiIDA[1]=IDS_CONFIRM_CANCEL; @@ -478,7 +478,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && noUGC ) { m_bIgnoreInput = false; @@ -495,7 +495,7 @@ HRESULT CScene_MultiGameCreate::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPr } } else if(hObjPressed==m_MoreOptions) - { + { app.NavigateToScene(pNotifyPressData->UserIndex,eUIScene_LaunchMoreOptionsMenu,&m_MoreOptionsParams); } else if(hObjPressed == m_ButtonGameMode) @@ -527,7 +527,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS if(result==C4JStorage::EMessage_ResultAccept) { if(ProfileManager.IsSignedIn(iPad)) - { + { ULONGLONG ullIndexA[1]; DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_pDLCPack->getPurchaseOfferId()); @@ -542,7 +542,7 @@ int CScene_MultiGameCreate::UnlockTexturePackReturned(void *pParam,int iPad,C4JS StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); - // the license change coming in when the offer has been installed will cause this scene to refresh + // the license change coming in when the offer has been installed will cause this scene to refresh } } else @@ -629,12 +629,12 @@ HRESULT CScene_MultiGameCreate::OnNotifyValueChanged (HXUIOBJ hObjSource, XUINot // Enable the done button when we have all of the necessary information wstring wWorldName = m_EditWorldName.GetText(); BOOL bHasWorldName = ( wWorldName.length()!=0); - m_NewWorld.SetEnable(bHasWorldName); + m_NewWorld.SetEnable(bHasWorldName); } else if(hObjSource==m_SliderDifficulty.GetSlider() ) { app.SetGameSettings(m_iPad,eGameSetting_Difficulty,pValueChangedData->nValue); - swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); + swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_DIFFICULTY ),app.GetString(m_iDifficultyTitleSettingA[pValueChangedData->nValue])); m_SliderDifficulty.SetText(TempString); } @@ -656,11 +656,11 @@ HRESULT CScene_MultiGameCreate::OnControlNavigate(XUIMessageControlNavigate *pCo HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) { - // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly + // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) { - + case GAME_CREATE_ONLINE_TIMER_ID: { bool bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); @@ -693,7 +693,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled } } break; - + case CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID: { // also check for any new texture packs info being available @@ -718,7 +718,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled PBYTE pbImageData=NULL; app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; ListInfo.iData = m_iConfigA[i]; HRESULT hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); app.DebugPrintf("Adding texturepack %d from TPD\n",m_iConfigA[i]); @@ -734,7 +734,7 @@ HRESULT CScene_MultiGameCreate::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled bool bAllDone=true; for(int i=0;im_MoreOptionsParams.bOnlineGame; @@ -780,7 +780,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && noUGC ) { pClass->m_bIgnoreInput = false; @@ -816,7 +816,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue if(ProfileManager.IsSignedIn(iPad)) { DWORD dwLocalUsersMask = 0; - + bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_MoreOptionsParams.bOnlineGame; bool noPrivileges = false; @@ -835,7 +835,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue BOOL pccFriendsAllowed = TRUE; ProfileManager.AllowedPlayerCreatedContent(ProfileManager.GetPrimaryPad(),false,&pccAllowed,&pccFriendsAllowed); if(!pccAllowed && !pccFriendsAllowed) noUGC = true; - + if(isClientSide && (noPrivileges || noUGC) ) { if( noUGC ) @@ -863,7 +863,7 @@ int CScene_MultiGameCreate::StartGame_SignInReturned(void *pParam,bool bContinue } } else - { + { pClass->m_bIgnoreInput = false; pClass->SetShow( TRUE ); } @@ -884,7 +884,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // create the world and launch wstring wWorldName = pClass->m_EditWorldName.GetText(); - + StorageManager.ResetSaveData(); // Make our next save default to the name of the level StorageManager.SetSaveTitle((wchar_t *)wWorldName.c_str()); @@ -904,11 +904,11 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw // start the game bool isFlat = (pClass->m_MoreOptionsParams.bFlatWorld==TRUE); - int64_t seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements + __int64 seedValue = 0; //BiomeSource::findSeed(isFlat?LevelType::lvl_flat:LevelType::lvl_normal); // 4J - was (new Random())->nextLong() - now trying to actually find a seed to suit our requirements if (wSeed.length() != 0) { - int64_t value = 0; + __int64 value = 0; unsigned int len = (unsigned int)wSeed.length(); //Check if the input string contains a numerical value @@ -923,7 +923,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw //If the input string is a numerical value, convert it to a number if( isNumber ) - value = _fromString(wSeed); + value = _fromString<__int64>(wSeed); //If the value is not 0 use it, otherwise use the algorithm from the java String.hashCode() function to hash it if( value != 0 ) @@ -948,7 +948,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw param->seed = seedValue; param->saveData = NULL; param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack; - + Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->skins->selectTexturePackById(pClass->m_MoreOptionsParams.dwTexturePack); //pMinecraft->skins->updateUI(); @@ -956,7 +956,7 @@ void CScene_MultiGameCreate::CreateGame(CScene_MultiGameCreate* pClass, DWORD dw app.SetGameHostOption(eGameHostOption_Difficulty,Minecraft::GetInstance()->options->difficulty); app.SetGameHostOption(eGameHostOption_FriendsOfFriends,pClass->m_MoreOptionsParams.bAllowFriendsOfFriends); app.SetGameHostOption(eGameHostOption_Gamertags,app.GetGameSettings(pClass->m_iPad,eGameSetting_GamertagsVisible)?1:0); - + app.SetGameHostOption(eGameHostOption_BedrockFog,app.GetGameSettings(pClass->m_iPad,eGameSetting_BedrockFog)?1:0); // CXuiList listObject; @@ -999,7 +999,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionStart( XUIMessageTransition *pTransi if(pTransition->dwTransAction==XUI_TRANSITION_ACTION_DESTROY ) return S_OK; if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) - { + { m_SliderDifficulty.SetValueDisplay(FALSE); } @@ -1015,7 +1015,7 @@ HRESULT CScene_MultiGameCreate::OnTransitionEnd( XUIMessageTransition *pTransiti { } else if(pTransition->dwTransType == XUI_TRANSITION_TO || pTransition->dwTransType == XUI_TRANSITION_BACKTO) - { + { if(m_bSetup && m_texturePackDescDisplayed) { XUITimeline *timeline; @@ -1054,7 +1054,7 @@ HRESULT CScene_MultiGameCreate::OnNotifySelChanged( HXUIOBJ hObjSource, XUINotif if(hObjSource == m_pTexturePacksList->m_hObj) { UpdateTexturePackDescription(pNotifySelChangedData->iItem); - + // 4J-JEV: Removed expand description check, taken care of elsewhere. } @@ -1205,9 +1205,9 @@ void CScene_MultiGameCreate::UpdateCurrentTexturePack() StorageManager.RequestMessageBox(IDS_DLC_TEXTUREPACK_NOT_PRESENT_TITLE, IDS_DLC_TEXTUREPACK_NOT_PRESENT, uiIDA, 2, ProfileManager.GetPrimaryPad(),&CScene_MultiGameCreate::TexturePackDialogReturned,this,app.GetStringTable()); } - // do set the texture pack id, and on the user pressing create world, check they have it + // do set the texture pack id, and on the user pressing create world, check they have it m_MoreOptionsParams.dwTexturePack = ListItem.iData; - return ; + return ; } else { @@ -1221,7 +1221,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS pClass->m_currentTexturePackIndex = pClass->m_pTexturePacksList->GetCurSel(); // Exit with or without saving // Decline means install full version of the texture pack in this dialog - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -1248,7 +1248,7 @@ int CScene_MultiGameCreate::TexturePackDialogReturned(void *pParam,int iPad,C4JS ullIndexA[0]=pDLCInfo->ullOfferID_Trial; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); } - } + } } pClass->m_bIgnoreInput=false; return 0; @@ -1274,12 +1274,12 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCInstalled() } HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() -{ +{ // refill the texture pack list m_pTexturePacksList->SetSelectionChangedHandle(m_hObj); Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; HRESULT hr; for(unsigned int i = 0; i < texturePacksCount; ++i) @@ -1292,7 +1292,7 @@ HRESULT CScene_MultiGameCreate::OnCustomMessage_DLCMountingComplete() if(dwImageBytes > 0 && pbImageData) { - ListInfo.fEnabled = TRUE; + ListInfo.fEnabled = TRUE; hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&ListInfo.hXuiBrush); DLCTexturePack *pDLCTexPack=(DLCTexturePack *)tp; diff --git a/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp b/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp index 142e8ba1..73f25da5 100644 --- a/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp +++ b/Minecraft.Client/Common/XUI/XUI_MultiGameJoinLoad.cpp @@ -42,13 +42,13 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand m_iTexturePacksNotInstalled=0; m_iConfigA=NULL; - + XuiControlSetText(m_LabelNoGames,app.GetString(IDS_NO_GAMES_FOUND)); XuiControlSetText(m_GamesList,app.GetString(IDS_JOIN_GAME)); XuiControlSetText(m_SavesList,app.GetString(IDS_START_GAME)); - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); @@ -64,17 +64,17 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand m_bRetrievingSaveInfo=false; m_bSaveTransferInProgress=false; - + // check for a default custom cloak in the global storage // 4J-PB - changed to a config file // if(ProfileManager.IsSignedInLive( m_iPad )) -// { +// { // app.InstallDefaultCape(); // } m_initData= new JoinMenuInitData(); m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); - + XPARTY_USER_LIST partyList; if((XPartyGetUserList( &partyList ) != XPARTY_E_NOT_IN_PARTY ) && (partyList.dwUserCount>1)) @@ -90,7 +90,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand if(m_bInParty) iLB = IDS_TOOLTIPS_PARTY_GAMES; XuiSetTimer(m_hObj,JOIN_LOAD_ONLINE_TIMER_ID,JOIN_LOAD_ONLINE_TIMER_TIME); - + m_iSaveInfoC=0; VOID *pObj; @@ -110,7 +110,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand { // if we're waiting for DLC to mount, don't fill the save list. The custom message on end of dlc mounting will do that m_bIgnoreInput=false; - + m_iChangingSaveGameInfoIndex = 0; @@ -135,7 +135,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand // saving is disabled, but we should still be able to load from a selected save device ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,iLB,IDS_TOOLTIPS_DELETESAVE); - + GetSaveInfo(); } else @@ -153,7 +153,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand // 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename) bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame(); ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_CHANGEDEVICE,-1,-1,-1,-1,bCanRename?IDS_TOOLTIPS_SAVEOPTIONS:IDS_TOOLTIPS_DELETESAVE); - + GetSaveInfo(); } } @@ -165,7 +165,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand // 4J Stu - Fix for #12530 -TCR 001 BAS Game Stability: Title will crash if the player disconnects while starting a new world and then opts to play the tutorial once they have been returned to the Main Menu. MinecraftServer::resetFlags(); - + // If we're not ignoring input, then we aren't still waiting for the DLC to mount, and can now check for corrupt dlc. Otherwise this will happen when the dlc has finished mounting. if( !m_bIgnoreInput) { @@ -191,7 +191,7 @@ HRESULT CScene_MultiGameJoinLoad::OnInit( XUIMessageInit* pInitData, BOOL& bHand bool bTexturePackAlreadyListed; bool bNeedToGetTPD=false; Minecraft *pMinecraft = Minecraft::GetInstance(); - int texturePacksCount = pMinecraft->skins->getTexturePackCount(); + int texturePacksCount = pMinecraft->skins->getTexturePackCount(); //CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; //HRESULT hr; @@ -295,7 +295,7 @@ void CScene_MultiGameJoinLoad::AddDefaultButtons() // increment the count of the mash-up pack worlds in the save list m_iMashUpButtonsC++; TexturePack *tp = Minecraft::GetInstance()->skins->getTexturePackById(levelGen->getRequiredTexturePackId()); - DWORD dwImageBytes; + DWORD dwImageBytes; PBYTE pbImageData = tp->getPackIcon(dwImageBytes); HXUIBRUSH hXuiBrush; @@ -353,8 +353,8 @@ HRESULT CScene_MultiGameJoinLoad::GetSaveInfo( ) ListInfo.fEnabled=TRUE; ListInfo.iData = -1; m_pSavesList->AddData(ListInfo); - } - m_pSavesList->SetCurSelVisible(0); + } + m_pSavesList->SetCurSelVisible(0); } else { @@ -419,7 +419,7 @@ int CScene_MultiGameJoinLoad::DeviceRemovedDialogReturned(void *pParam,int iPad, CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false); @@ -462,7 +462,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify //CScene_MultiGameInfo::JoinMenuInitData *initData = new CScene_MultiGameInfo::JoinMenuInitData(); m_initData->iPad = m_iPad; m_initData->selectedSession = currentSessions.at( nIndex ); - + // check that we have the texture pack available // If it's not the default texture pack if(m_initData->selectedSession->data.texturePackParentId!=0) @@ -513,7 +513,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify return S_OK; } } - + m_NetGamesListTimer.SetShow( FALSE ); // Reset the background downloading, in case we changed it by attempting to download a texture pack @@ -536,7 +536,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify CXuiCtrl4JList::LIST_ITEM_INFO info = m_pSavesList->GetData(iIndex); if(iIndex == JOIN_LOAD_CREATE_BUTTON_INDEX) - { + { app.SetTutorialMode( false ); m_NetGamesListTimer.SetShow( FALSE ); @@ -571,7 +571,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify } } else - { + { // check if this is a damaged save if(m_pSavesList->GetData(iIndex).bIsDamaged) { @@ -582,7 +582,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pNotifyPressData->UserIndex,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,this, app.GetStringTable()); } else - { + { app.SetTutorialMode( false ); if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) { @@ -605,7 +605,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotify } } } - + return S_OK; } @@ -632,11 +632,11 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r app.NavigateBack(XUSER_INDEX_ANY); rfHandled = TRUE; - break; + break; case VK_PAD_X: // Change device - // Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage + // Fix for #12531 - TCR 001: BAS Game Stability: When a player selects to change a storage // device, and repeatedly backs out of the SD screen, disconnects from LIVE, and then selects a SD, the title crashes. m_bIgnoreInput=true; StorageManager.SetSaveDevice(&CScene_MultiGameJoinLoad::DeviceSelectReturned,this,true); @@ -657,7 +657,7 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r { // save transfer - make sure they want to overwrite a save that is up there if(ProfileManager.IsSignedInLive( m_iPad )) - { + { // 4J-PB - required for a delete of the save if it's found to be a corrupted save DWORD nIndex = m_pSavesList->GetCurSel(); m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(nIndex).iIndex; @@ -668,13 +668,13 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r ui.RequestMessageBox(IDS_SAVE_TRANSFER_TITLE, IDS_SAVE_TRANSFER_TEXT, uiIDA, 2, pInputData->UserIndex,&CScene_MultiGameJoinLoad::SaveTransferDialogReturned,this, app.GetStringTable()); } - } + } break; case VK_PAD_RSHOULDER: if(DoesSavesListHaveFocus()) { m_bIgnoreInput = true; - + int iIndex=m_SavesList.GetCurSel(); m_iChangingSaveGameInfoIndex=m_pSavesList->GetData(iIndex).iIndex; @@ -755,19 +755,19 @@ HRESULT CScene_MultiGameJoinLoad::OnKeyDown(XUIMessageInput* pInputData, BOOL& r } break; } - + return hr; } HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled) { - + CXuiSceneBase::ShowLogo( DEFAULT_XUI_MENU_USER, TRUE ); // start the texture pack timer again XuiSetTimer(m_hObj,CHECKFORAVAILABLETEXTUREPACKS_TIMER_ID,CHECKFORAVAILABLETEXTUREPACKS_TIMER_TIME); - m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); - + m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad); + // re-enable button presses m_bIgnoreInput=false; @@ -812,7 +812,7 @@ HRESULT CScene_MultiGameJoinLoad::OnNavReturn(HXUIOBJ hSceneFrom,BOOL& rfHandled iY = IDS_TOOLTIPS_VIEW_GAMERCARD; } else if(DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -901,7 +901,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTransitionStart( XUIMessageTransition *pTran if(pTransition->dwTransType == XUI_TRANSITION_BACKTO) { // Can't call this here because if you back out of the load info screen and then go back in and load a game, it will attempt to use the dlc as it's running a mount of the dlc - + // block input if we're waiting for DLC to install, and wipe the saves list. The end of dlc mounting custom message will fill the list again if(app.StartInstallDLCProcess(m_iPad)==false) { @@ -925,14 +925,14 @@ HRESULT CScene_MultiGameJoinLoad::OnFontRendererChange() // update the tooltips // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should the the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; if( DoesGamesListHaveFocus() ) { iY = IDS_TOOLTIPS_VIEW_GAMERCARD; - } + } else if(DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -986,12 +986,12 @@ HRESULT CScene_MultiGameJoinLoad::OnNotifySetFocus(HXUIOBJ hObjSource, XUINotify // update the tooltips // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should the the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; if( DoesGamesListHaveFocus() ) { iY = IDS_TOOLTIPS_VIEW_GAMERCARD; - } + } else if(DoesSavesListHaveFocus()) { if(ProfileManager.IsSignedInLive( m_iPad )) @@ -1118,7 +1118,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesListCallback(LPVOID lpParam) // check this there's no save transfer in progress if(!pClass->m_bSaveTransferInProgress) { - pClass->UpdateGamesList(); + pClass->UpdateGamesList(); } } } @@ -1150,12 +1150,12 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() delete (*it); } currentSessions.clear(); - + m_NetGamesListTimer.SetShow( FALSE ); - + // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should show the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; if( DoesGamesListHaveFocus() ) @@ -1163,7 +1163,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() iY = IDS_TOOLTIPS_VIEW_GAMERCARD; } else if(DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -1282,7 +1282,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() // is it in the tpd data ? app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes ); if(dwImageBytes > 0 && pbImageData) - { + { hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush); m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush); } @@ -1291,7 +1291,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() { pbImageData = tp->getPackIcon(dwImageBytes); if(dwImageBytes > 0 && pbImageData) - { + { hr=XuiCreateTextureBrushFromMemory(pbImageData,dwImageBytes,&hXuiBrush); m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush); } @@ -1303,7 +1303,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList() XuiCreateTextureBrushFromMemory(m_DefaultMinecraftIconData,m_DefaultMinecraftIconSize,&hXuiBrush); m_pGamesList->UpdateGraphic(sessionIndex,hXuiBrush); } - + if(memcmp( &selectedSessionId, &sessionInfo->sessionId, sizeof(SessionID) ) == 0) { @@ -1324,14 +1324,14 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear if(m_searches>0) --m_searches; - + if(m_searches==0) { m_NetGamesListTimer.SetShow( FALSE ); - + // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should show the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; if( DoesGamesListHaveFocus() ) @@ -1374,7 +1374,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear } unsigned int startOffset = m_GamesList.GetItemCount(); - //m_GamesList.InsertItems(startOffset,dwNumResults); + //m_GamesList.InsertItems(startOffset,dwNumResults); //m_GamesList.SetEnable(TRUE); //XuiElementSetDisableFocusRecursion( m_GamesList.m_hObj, FALSE); @@ -1449,7 +1449,7 @@ void CScene_MultiGameJoinLoad::UpdateGamesList(DWORD dwNumResults, IQNetGameSear #endif } } - + if( m_GamesList.GetItemCount() == 0) { m_LabelNoGames.SetShow( TRUE ); @@ -1537,14 +1537,14 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) { // if the saves list has focus, then we should show the Delete Save tooltip // if the games list has focus, then we should show the View Gamercard tooltip - int iRB=-1; + int iRB=-1; int iY = -1; if( pClass->DoesGamesListHaveFocus() ) { iY = IDS_TOOLTIPS_VIEW_GAMERCARD; } else if(pClass->DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( pClass->m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -1593,7 +1593,7 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) pClass->GetSaveInfo(); } else - { + { ui.SetTooltips( DEFAULT_XUI_MENU_USER, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK,IDS_TOOLTIPS_SELECTDEVICE,iY,-1,-1,iLB,iRB); // clear the saves list pClass->m_pSavesList->RemoveAllData(); @@ -1623,11 +1623,11 @@ int CScene_MultiGameJoinLoad::DeviceSelectReturned(void *pParam,bool bContinue) HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) { - // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly + // 4J-PB - TODO - Don't think we can do this - if a 2nd player signs in here with an offline profile, the signed in LIVE player gets re-logged in, and bMultiplayerAllowed is false briefly switch(pTimer->nId) { - + case JOIN_LOAD_ONLINE_TIMER_ID: { XPARTY_USER_LIST partyList; @@ -1673,7 +1673,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl { } else if(DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -1737,7 +1737,7 @@ HRESULT CScene_MultiGameJoinLoad::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandl //CXuiCtrl4JList::LIST_ITEM_INFO ListInfo; // for each iConfig, check if the data is available, and add it to the List, then remove it from the viConfig - + for(int i=0;im_iSaveInfoC=0; pClass->GetSaveInfo(); } - + pClass->m_bIgnoreInput=false; return 0; } void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen) -{ +{ // Load data from disc //File saveFile( L"Tutorial\\Tutorial" ); //LoadSaveFromDisk(&saveFile); // clear out the app's terrain features list app.ClearTerrainFeaturePosition(); - + StorageManager.ResetSaveData(); // Make our next save default to the name of the level StorageManager.SetSaveTitle(levelGen->getDefaultSaveName().c_str()); - + bool isClientSide = false; bool isPrivate = false; int maxPlayers = MINECRAFT_NET_MAX_PLAYERS; @@ -1918,7 +1918,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen) if(levelGen->requiresTexturePack()) { param->texturePackId = levelGen->getRequiredTexturePackId(); - + Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->skins->selectTexturePackById(param->texturePackId); //pMinecraft->skins->updateUI(); @@ -1939,7 +1939,7 @@ void CScene_MultiGameJoinLoad::LoadLevelGen(LevelGenerationOptions *levelGen) } void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) -{ +{ // we'll only be coming in here when the tutorial is loaded now StorageManager.ResetSaveData(); @@ -1947,12 +1947,12 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) // Make our next save default to the name of the level StorageManager.SetSaveTitle(saveFile->getName().c_str()); - int64_t fileSize = saveFile->length(); + __int64 fileSize = saveFile->length(); FileInputStream fis(*saveFile); byteArray ba(fileSize); fis.read(ba); fis.close(); - + bool isClientSide = false; bool isPrivate = false; int maxPlayers = MINECRAFT_NET_MAX_PLAYERS; @@ -1962,7 +1962,7 @@ void CScene_MultiGameJoinLoad::LoadSaveFromDisk(File *saveFile) isClientSide = false; maxPlayers = 4; } - + app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId()); g_NetworkManager.HostGame(0,isClientSide,isPrivate,maxPlayers,0); @@ -1992,7 +1992,7 @@ int CScene_MultiGameJoinLoad::DeleteSaveDialogReturned(void *pParam,int iPad,C4J { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultDecline) + if(result==C4JStorage::EMessage_ResultDecline) { if(app.DebugSettingsOn() && app.GetLoadSavesFromFolderEnabled()) { @@ -2017,7 +2017,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad*)pParam; // results switched for this dialog - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { // upload the save @@ -2042,7 +2042,7 @@ int CScene_MultiGameJoinLoad::SaveTransferDialogReturned(void *pParam,int iPad,C int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter ) { CScene_MultiGameJoinLoad* pClass = (CScene_MultiGameJoinLoad *) lpParameter; - Minecraft *pMinecraft = Minecraft::GetInstance(); + Minecraft *pMinecraft = Minecraft::GetInstance(); pMinecraft->progressRenderer->progressStart(IDS_SAVE_TRANSFER_TITLE); pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADING ); @@ -2092,7 +2092,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter StorageManager.GetSaveCacheFileInfo(iIndex,XContentData); StorageManager.GetSaveCacheFileInfo(iIndex,&pbImageData,&dwImageBytes); - // if there is no thumbnail, retrieve the default one from the file. + // if there is no thumbnail, retrieve the default one from the file. // Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save if(pbImageData==NULL) { @@ -2143,7 +2143,7 @@ int CScene_MultiGameJoinLoad::UploadSaveForXboxOneThreadProc( LPVOID lpParameter return 0; } - // change text for completion confirmation + // change text for completion confirmation pMinecraft->progressRenderer->progressStage( IDS_SAVE_TRANSFER_UPLOADCOMPLETE ); // done @@ -2180,7 +2180,7 @@ void CScene_MultiGameJoinLoad::UploadFile(CScene_MultiGameJoinLoad *pClass, char C4JStorage::TMS_FILETYPE_BINARY, C4JStorage::TMS_UGCTYPE_NONE, filename, - (CHAR *)data, + (CHAR *)data, size, &CScene_MultiGameJoinLoad::TransferComplete,pClass, 0, &CScene_MultiGameJoinLoad::Progress,pClass); @@ -2219,7 +2219,7 @@ bool CScene_MultiGameJoinLoad::WaitForTransferComplete( CScene_MultiGameJoinLoad // cancelled return false; } - Sleep(50); + Sleep(50); // update the progress pMinecraft->progressRenderer->progressStagePercentage((unsigned int)(pClass->m_fProgress*100.0f)); } @@ -2235,7 +2235,7 @@ int CScene_MultiGameJoinLoad::SaveOptionsDialogReturned(void *pParam,int iPad,C4 // results switched for this dialog // EMessage_ResultAccept means cancel - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultThirdOption) { if(result==C4JStorage::EMessage_ResultDecline) // rename { @@ -2302,9 +2302,9 @@ int CScene_MultiGameJoinLoad::LoadSaveDataReturned(void *pParam,bool bContinue) UINT uiIDA[2]; uiIDA[0]=IDS_CONFIRM_CANCEL; uiIDA[1]=IDS_CONFIRM_OK; - StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, + StorageManager.RequestMessageBox(IDS_CORRUPT_OR_DAMAGED_SAVE_TITLE, IDS_CORRUPT_OR_DAMAGED_SAVE_TEXT, uiIDA, 2, pClass->m_iPad,&CScene_MultiGameJoinLoad::DeleteSaveDialogReturned,pClass, app.GetStringTable()); - + } return 0; @@ -2366,7 +2366,7 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet) if(eLoadStatus==C4JStorage::ELoadGame_DeviceRemoved) { - // disable saving + // disable saving StorageManager.SetSaveDisabled(true); StorageManager.SetSaveDeviceSelected(ProfileManager.GetPrimaryPad(),false); UINT uiIDA[1]; @@ -2375,11 +2375,11 @@ int CScene_MultiGameJoinLoad::KeyboardReturned(void *pParam,bool bSet) } #else // rename the save - + #endif } else - { + { pClass->m_bIgnoreInput=false; } @@ -2400,7 +2400,7 @@ int CScene_MultiGameJoinLoad::LoadSaveDataForRenameReturned(void *pParam,bool bC StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,XContentData); StorageManager.GetSaveCacheFileInfo(pClass->m_iChangingSaveGameInfoIndex-pClass->m_iDefaultButtonsC,&pbImageData,&dwImageBytes); - // if there is no thumbnail, retrieve the default one from the file. + // if there is no thumbnail, retrieve the default one from the file. // Don't delete the image data after creating the xuibrush, since we'll use it in the rename of the save if(pbImageData==NULL) { @@ -2456,7 +2456,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4 // Exit with or without saving // Decline means install full version of the texture pack in this dialog - if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultDecline || result==C4JStorage::EMessage_ResultAccept) { // we need to enable background downloading for the DLC XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW); @@ -2480,7 +2480,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4 ullIndexA[0]=pDLCInfo->ullOfferID_Trial; StorageManager.InstallOffer(1,ullIndexA,NULL,NULL); } - } + } } pClass->m_bIgnoreInput=false; return 0; @@ -2489,7 +2489,7 @@ int CScene_MultiGameJoinLoad::TexturePackDialogReturned(void *pParam,int iPad,C4 HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled() { // mounted DLC may have changed - + if(app.StartInstallDLCProcess(m_iPad)==false) { // not doing a mount, so re-enable input @@ -2508,7 +2508,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCInstalled() } HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete() -{ +{ VOID *pObj; XuiObjectFromHandle( m_SavesList, &pObj ); @@ -2534,7 +2534,7 @@ HRESULT CScene_MultiGameJoinLoad::OnCustomMessage_DLCMountingComplete() int iY=-1; if(DoesSavesListHaveFocus()) - { + { if(ProfileManager.IsSignedInLive( m_iPad )) { iY=IDS_TOOLTIPS_UPLOAD_SAVE_FOR_XBOXONE; @@ -2627,7 +2627,7 @@ void CScene_MultiGameJoinLoad::UpdateTooltips() // 4J-PB - we need to check that there is enough space left to create a copy of the save (for a rename) bool bCanRename = StorageManager.EnoughSpaceForAMinSaveGame(); - if(bCanRename) + if(bCanRename) { iRB=IDS_TOOLTIPS_SAVEOPTIONS; } @@ -2694,11 +2694,11 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave pbCurrentImagePtr=pbImageData+InfoA[i].dwImageOffset; hr=XuiCreateTextureBrushFromMemory(pbCurrentImagePtr,InfoA[i].dwImageBytes,&hXuiBrush); pClass->m_pSavesList->UpdateGraphic(i+pClass->m_iDefaultButtonsC,hXuiBrush ); - } + } else { // we could put in a damaged save icon here - const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string + const DWORD LOCATOR_SIZE = 256; // Use this to allocate space to hold a ResourceLocator string WCHAR szResourceLocator[ LOCATOR_SIZE ]; const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); @@ -2724,7 +2724,7 @@ bool CScene_MultiGameJoinLoad::GetSavesInfoCallback(LPVOID pParam,int iTotalSave // It's possible that the games list is updated but we haven't displayed it yet as we were still waiting on saves list to load // This is to fix a bug where joining a game before the saves list has loaded causes a crash when this callback is called // as the scene no longer exists - pClass->UpdateGamesList(); + pClass->UpdateGamesList(); // Fix for #45154 - Frontend: DLC: Content can only be downloaded from the frontend if you have not joined/exited multiplayer XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO); diff --git a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp index 1a679f58..03782c79 100644 --- a/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp +++ b/Minecraft.Client/Common/XUI/XUI_Scene_Base.cpp @@ -36,7 +36,7 @@ HRESULT CXuiSceneBase::OnInit( XUIMessageInit* pInitData, BOOL& bHandled ) MapChildControls(); // Display the tooltips - HRESULT hr = S_OK; + HRESULT hr = S_OK; CXuiElement xuiElement = m_hObj; HXUIOBJ hTemp; @@ -169,7 +169,7 @@ void CXuiSceneBase::_TickAllBaseScenes() // make sure there's not a mount going on before using the textures if(bCheckTexturePack && app.DLCInstallProcessCompleted() ) - { + { TexturePack *tPack = pMinecraft->skins->getSelected(); if(tPack->getId()!=app.GetRequiredTexturePackID()) @@ -186,7 +186,7 @@ void CXuiSceneBase::_TickAllBaseScenes() pMinecraft->skins->selectTexturePackById(app.GetRequiredTexturePackID()); - // probably had background downloads enabled, so turn them off + // probably had background downloads enabled, so turn them off XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO); } else @@ -223,7 +223,7 @@ void CXuiSceneBase::_TickAllBaseScenes() { if(pMinecraft->localplayers[i] != NULL && pMinecraft->localplayers[i]->dimension == 1 && !ui.GetMenuDisplayed(i) && app.GetGameSettings(i,eGameSetting_DisplayHUD)) { - int iGuiScale; + int iGuiScale; if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -234,7 +234,7 @@ void CXuiSceneBase::_TickAllBaseScenes() iGuiScale=app.GetGameSettings(i,eGameSetting_UISizeSplitscreen); } m_BossHealthGroup[i].SetShow(TRUE); - m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) ); + m_BossHealthText[i].SetText( app.GetString( IDS_BOSS_ENDERDRAGON_HEALTH ) ); if(pMinecraft->localplayers[i]->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN) { @@ -364,7 +364,7 @@ void CXuiSceneBase::_TickAllBaseScenes() break; } } - } + } m_pBossHealthProgress[i].SetRange(0, boss->getMaxHealth() ); m_pBossHealthProgress[i].SetValue( boss->getSynchedHealth() ); @@ -468,15 +468,15 @@ void CXuiSceneBase::_TickAllBaseScenes() XUIMessage xuiMsg; CustomMessage_TickScene( &xuiMsg ); XuiSendMessage( app.GetCurrentHUDScene(i), &xuiMsg ); - + bool bDisplayGui=app.GetGameStarted() && !ui.GetMenuDisplayed(i) && !(app.GetXuiAction(i)==eAppAction_AutosaveSaveGameCapturedThumbnail) && app.GetGameSettings(i,eGameSetting_DisplayHUD)!=0; if(bDisplayGui && pMinecraft->localplayers[i] != NULL) { - XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE); + XuiElementSetShow(app.GetCurrentHUDScene(i),TRUE); } else { - XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); + XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); } } } @@ -495,18 +495,18 @@ HRESULT CXuiSceneBase::_SetEnableTooltips( unsigned int iPad, BOOL bVal ) HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiTooltip, int iTextID ) { ASSERT( uiTooltip < BUTTONS_TOOLTIP_MAX ); - + XUIRect xuiRect, xuiRectSmall; HRESULT hr=S_OK; LPCWSTR pString=NULL; float fWidth,fHeight; - + // Want to be able to show just a button (for RB LB) if(iTextID>=0) { pString=app.GetString(iTextID); } - + if(hTooltipText[iPad][uiTooltip]==NULL) { HXUIOBJ hObj=NULL; @@ -514,7 +514,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti hr=XuiElementGetChildById(hObj,L"text_ButtonText",&hTooltipText[iPad][uiTooltip]); hr=XuiElementGetPosition(hTooltipText[iPad][uiTooltip],&m_vPosTextInTooltip[uiTooltip]); } - + if(hTooltipTextSmall[iPad][uiTooltip]==NULL) { HXUIOBJ hObj=NULL; @@ -525,8 +525,8 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti if(iTextID>=0) { - hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect); - + hr=XuiTextPresenterMeasureText(hTooltipText[iPad][uiTooltip], pString, &xuiRect); + // Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic) XuiElementGetBounds(m_Buttons[iPad][uiTooltip].m_hObj,&fWidth, &fHeight); XuiElementSetBounds(m_Buttons[iPad][uiTooltip].m_hObj,xuiRect.right+1+m_vPosTextInTooltip[uiTooltip].x,fHeight); @@ -537,7 +537,7 @@ HRESULT CXuiSceneBase::_SetTooltipText( unsigned int iPad, unsigned int uiToolti hr=XuiTextPresenterMeasureText(hTooltipTextSmall[iPad][uiTooltip], pString, &xuiRectSmall); - + // Change the size of the whole button to be the width of the measured text, plus the position the text element starts in the visual (which is the offset by the size of the button graphic) XuiElementGetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,&fWidth, &fHeight); XuiElementSetBounds(m_ButtonsSmall[iPad][uiTooltip].m_hObj,xuiRectSmall.right+1+m_vPosTextInTooltipSmall[uiTooltip].x,fHeight); @@ -749,7 +749,7 @@ HRESULT CXuiSceneBase::_SetTooltipsEnabled( unsigned int iPad, bool bA, bool bB, m_Buttons[iPad][BUTTON_TOOLTIP_LB].SetEnable( bLB ); m_Buttons[iPad][BUTTON_TOOLTIP_RB].SetEnable( bRB ); m_Buttons[iPad][BUTTON_TOOLTIP_LS].SetEnable( bLS ); - + m_ButtonsSmall[iPad][BUTTON_TOOLTIP_A].SetEnable( bA ); m_ButtonsSmall[iPad][BUTTON_TOOLTIP_B].SetEnable( bB ); m_ButtonsSmall[iPad][BUTTON_TOOLTIP_X].SetEnable( bX ); @@ -860,7 +860,7 @@ HRESULT CXuiSceneBase::_ShowBackground( unsigned int iPad, BOOL bShow ) if(bShow && pMinecraft->level!=NULL) { - int64_t i64TimeOfDay =0; + __int64 i64TimeOfDay =0; // are we in the Nether? - Leave the time as 0 if we are, so we show daylight if(pMinecraft->level->dimension->id==0) { @@ -945,11 +945,11 @@ HRESULT CXuiSceneBase::_ShowPressStart(unsigned int iPad) int nStart, nEnd; // XuiElementFindNamedFrame( m_hObj, L"StartFlash", &nStart ); // XuiElementFindNamedFrame( m_hObj, L"EndFlash", &nEnd ); -// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE ); +// XuiElementPlayTimeline( m_hObj, nStart, nStart, nEnd, TRUE, TRUE ); XuiElementFindNamedFrame( hObj, L"StartFlash", &nStart ); XuiElementFindNamedFrame( hObj, L"EndFlash", &nEnd ); - XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE ); - + XuiElementPlayTimeline( hObj, nStart, nStart, nEnd, TRUE, TRUE ); + return S_OK; } @@ -960,7 +960,7 @@ HRESULT CXuiSceneBase::_HidePressStart() HRESULT CXuiSceneBase::_UpdateAutosaveCountdownTimer(unsigned int uiSeconds) { - WCHAR wcAutosaveCountdown[100]; + WCHAR wcAutosaveCountdown[100]; swprintf( wcAutosaveCountdown, 100, app.GetString(IDS_AUTOSAVE_COUNTDOWN),uiSeconds); m_TrialTimer.SetText(wcAutosaveCountdown); return S_OK; @@ -974,7 +974,7 @@ HRESULT CXuiSceneBase::_ShowAutosaveCountdownTimer(BOOL bVal) HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) { - WCHAR wcTime[20]; + WCHAR wcTime[20]; DWORD dwTimeTicks=(DWORD)app.getTrialTimer(); @@ -982,7 +982,7 @@ HRESULT CXuiSceneBase::_UpdateTrialTimer(unsigned int iPad) { dwTimeTicks=m_dwTrialTimerLimitSecs; } - + dwTimeTicks=m_dwTrialTimerLimitSecs-dwTimeTicks; #ifndef _CONTENT_PACKAGE @@ -1038,7 +1038,7 @@ bool CXuiSceneBase::_PressStartPlaying(unsigned int iPad) HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScenePosition position ) { // turn off the empty quadrant logo - if(m_hEmptyQuadrantLogo!=NULL) + if(m_hEmptyQuadrantLogo!=NULL) { XuiElementSetShow(m_hEmptyQuadrantLogo,FALSE); } @@ -1086,12 +1086,12 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen XuiElementSetShow( m_TooltipGroupSmall[iPad].m_hObj, TRUE); } - if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) - { + if(!RenderManager.IsHiDef() && !RenderManager.IsWidescreen()) + { //640x480 ->1280x720 scale.x = 2.0f; scale.y = 1.5f; scale.z = 1.0f; XuiElementSetScale(m_hObj, &scale); - + return S_OK; } @@ -1127,7 +1127,7 @@ HRESULT CXuiSceneBase::_SetPlayerBaseScenePosition( unsigned int iPad, EBaseScen // No position adjustment case e_BaseScene_Fullscreen: tooltipsPos.x=SAFEZONE_HALF_WIDTH; - tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight; + tooltipsPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight; crouchIconPos.x=SAFEZONE_HALF_WIDTH; crouchIconPos.y=SAFEZONE_HALF_HEIGHT; fBackWidth=XUI_BASE_SCENE_WIDTH; @@ -1303,7 +1303,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // Only adjust if fullscreen for now, leaving code to move others if required, but it's too far up the screen when on the bottom quadrants - if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) && + if( (m_playerBaseScenePosition[iPad] == e_BaseScene_Fullscreen) && (RenderManager.IsHiDef() || RenderManager.IsWidescreen()) ) { D3DXVECTOR3 selectedItemPos; @@ -1328,17 +1328,17 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // The move applies to the whole scene, so we'll need to move tooltips back in some cases - selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight; + selectedItemPos.y=XUI_BASE_SCENE_HEIGHT-SAFEZONE_HALF_HEIGHT-fTooltipHeight - fSelectedItemHeight; selectedItemPos.x = XUI_BASE_SCENE_WIDTH_HALF - (fSelectedItemWidth/2.0f); // Adjust selectedItemPos based on what gui is displayed - // 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival + // 4J-PB - selected the gui scale based on the slider settings, and on whether we're in Creative or Survival float fYOffset=0.0f; unsigned char ucGuiScale=app.GetGameSettings(iPad,eGameSetting_UISize) + 2; - + if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer()) { // SURVIVAL MODE - Move up further because of hearts, shield and xp @@ -1353,7 +1353,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = -94.0f; break; - } + } } else { @@ -1368,7 +1368,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = -58.0f; break; - } + } } @@ -1425,14 +1425,14 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) // 4J-PB - If it's in split screen vertical, adjust the position // Adjust selectedItemPos based on what gui is displayed if((m_playerBaseScenePosition[iPad]==e_BaseScene_Left) || (m_playerBaseScenePosition[iPad]==e_BaseScene_Right)) - { + { float scale=0.5f; selectedItemPos.y -= (scale * 88.0f); if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localgameModes[iPad] != NULL && Minecraft::GetInstance()->localgameModes[iPad]->canHurtPlayer()) { selectedItemPos.y -= (scale * 80.0f); } - + // 4J-PB - selected the gui scale based on the slider settings unsigned char ucGuiScale; float fYOffset=0.0f; @@ -1455,7 +1455,7 @@ void CXuiSceneBase::_UpdateSelectedItemPos(unsigned int iPad) default: // 2 fYOffset = 85.0f; break; - } + } selectedItemPos.y+=fYOffset; } @@ -1606,7 +1606,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay ) { // The host decides whether these are on or off if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0) - { + { if(Minecraft::GetInstance() != NULL && Minecraft::GetInstance()->localplayers[iPad]!=NULL) { wstring wsGamertag = convStringToWstring( ProfileManager.GetGamertag(iPad)); @@ -1621,7 +1621,7 @@ HRESULT CXuiSceneBase::_DisplayGamertag( unsigned int iPad, BOOL bDisplay ) } // The host decides whether these are on or off if(app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_DisplaySplitscreenGamertags)!=0) - { + { XuiElementSetShow(m_hGamerTagA[iPad],bDisplay); // set the opacity of the gamertag @@ -1712,11 +1712,11 @@ void CXuiSceneBase::_HideAllGameUIElements() m_uiSelectedItemOpacityCountDown[i] = 0; m_selectedItemA[i].SetShow(FALSE); m_selectedItemSmallA[i].SetShow(FALSE); - + m_BossHealthGroup[i].SetShow(FALSE); m_bossHealthVisible[i] = FALSE; - XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); + XuiElementSetShow(app.GetCurrentHUDScene(i),FALSE); _DisplayGamertag(i,FALSE); } @@ -1845,12 +1845,12 @@ void CXuiSceneBase::ReLayout( unsigned int iPad ) if( i>0 && lastVisible!=-1 ) { float width, height; - XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height); + XuiElementGetBounds(m_Buttons[iPad][lastVisible].m_hObj, &width, &height); // 4J Stu - This is for horizontal layout, will need changed if we do vertical layout lastPos.x += width + m_iTooltipSpacingGap; - XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height); + XuiElementGetBounds(m_ButtonsSmall[iPad][lastVisible].m_hObj, &width, &height); // 4J Stu - This is for horizontal layout, will need changed if we do vertical layout lastPosSmall.x += width + m_iTooltipSpacingGapSmall; } @@ -1948,15 +1948,15 @@ HRESULT CXuiSceneBase::SetTooltips( unsigned int iPad, int iA, int iB, int iX, i } else { - // does the tooltip need to change? + // does the tooltip need to change? if(CXuiSceneBase::Instance->m_iCurrentTooltipTextID[iPad][i]!=iTooptipsA[i] || forceUpdate) { CXuiSceneBase::Instance->SetTooltipText(iPad, i, iTooptipsA[i] ); - } + } CXuiSceneBase::Instance->_ShowTooltip(iPad, i, true ); } } - + } return S_OK; } @@ -2067,14 +2067,14 @@ HRESULT CXuiSceneBase::SetPlayerBasePositions(EBaseScenePosition pad0, EBaseScen } HRESULT CXuiSceneBase::UpdatePlayerBasePositions() -{ +{ EBaseScenePosition padPositions[XUSER_MAX_COUNT]; for(unsigned int idx = 0; idx < XUSER_MAX_COUNT; ++idx) { padPositions[idx] = e_BaseScene_NotSet; } - + Minecraft *pMinecraft = Minecraft::GetInstance(); // If the game is not started (or is being held paused for a bit) then display all scenes fullscreen @@ -2134,7 +2134,7 @@ HRESULT CXuiSceneBase::UpdatePlayerBasePositions() padPositions[idx] = e_BaseScene_Right; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT: - padPositions[idx] = e_BaseScene_Top_Left; + padPositions[idx] = e_BaseScene_Top_Left; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT: padPositions[idx] = e_BaseScene_Top_Right; @@ -2168,7 +2168,7 @@ void CXuiSceneBase::UpdateSelectedItemPos(int iPad) CXuiSceneBase::Instance->_UpdateSelectedItemPos(iPad); } -HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad) +HXUIOBJ CXuiSceneBase::GetPlayerBaseScene(int iPad) { return CXuiSceneBase::Instance->_GetPlayerBaseScene(iPad); } diff --git a/Minecraft.Client/Common/zlib/zconf.h b/Minecraft.Client/Common/zlib/zconf.h index 8fd83696..9987a775 100644 --- a/Minecraft.Client/Common/zlib/zconf.h +++ b/Minecraft.Client/Common/zlib/zconf.h @@ -485,7 +485,7 @@ typedef uLong FAR uLongf; # define z_off64_t off64_t #else # if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t long long +# define z_off64_t __int64 # else # define z_off64_t z_off_t # endif -- cgit v1.2.3