diff --git a/Minecraft.Client/AchievementPopup.h b/Minecraft.Client/AchievementPopup.h index 3085dc6e..4304a7e5 100644 --- a/Minecraft.Client/AchievementPopup.h +++ b/Minecraft.Client/AchievementPopup.h @@ -13,7 +13,7 @@ private: wstring title; wstring desc; Achievement *ach; - __int64 startTime; + int64_t startTime; ItemRenderer *ir; bool isHelper; diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index b047f58e..0e55ec9f 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 fileSize = gtsFile.length(); -// +// +// int64_t 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 ullOfferID_Full, __uint64 ullOfferID_Trial, WCHAR *pFirstSkin, unsigned int uiSortIndex, int iConfig, WCHAR *pDataFile) +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 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 110054f2..68f4ccd4 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, __uint64, WCHAR *, unsigned int, int, WCHAR *pDataFile); + static HRESULT RegisterDLCData(WCHAR *, WCHAR *, int, uint64_t, uint64_t, 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 seed, bool hasSeed, unsigned int uiHostOptions, unsigned int uiTexturePackId); + unsigned int CreateImageTextData(PBYTE bTextMetadata, int64_t 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 21c42dea..e5dffb3c 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 m_totalBlocksChanged; - __int64 m_totalBlocksChangedLighting; + int64_t m_totalBlocksChanged; + int64_t 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 4a4e27b2..0eef096b 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 ConsoleSchematicFile::applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t 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 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 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 ConsoleSchematicFile::applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot) +int64_t 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 f37a6058..b0eebf9e 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 applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); - __int64 applyLighting(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t applyBlocksAndData(LevelChunk *chunk, AABB *chunkBox, AABB *destinationBox, ESchematicRotation rot); + int64_t 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 bdc2ceff..3b9dba7e 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 i64; + int64_t 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 0c6a7804..373030d4 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 version = dis.readShort(); + int64_t 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 717b066e..a36d8549 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<__int64>(attributeValue); + m_seed = _fromString(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 LevelGenerationOptions::getLevelSeed() { return m_seed; } +int64_t 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 0cc9da79..6ae6f033 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 m_seed; + int64_t 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 getLevelSeed(); + int64_t 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 2a80f80a..5fd72e40 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 CGameNetworkManager::messageQueue[512]; -__int64 CGameNetworkManager::byteQueue[512]; +int64_t CGameNetworkManager::messageQueue[512]; +int64_t 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 seed = 0; + int64_t 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 sseed = seed; // Create static version so this will be valid until next call to this function & whilst thread is running + static int64_t 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 seed = 0; + int64_t 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 1bb532da..482cfd2a 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 messageQueue[messageQueue_length]; + static int64_t messageQueue[messageQueue_length]; static const int byteQueue_length = 512; - static __int64 byteQueue[byteQueue_length]; + static int64_t 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 ccb1957d..d745fb85 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 SonyRemoteStorage::getSaveSeed() +int64_t 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 seed = 0; + uint64_t 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 time = System::currentTimeMillis(); + int64_t 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 f435848e..3967a109 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 getSaveSeed(); + int64_t 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 m_startTime; + int64_t 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 b0a0d665..f7e44b17 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 currentTime = pMinecraft->level->getTime(); + int64_t 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 targetTime = currentTime + timeToAdd; + int64_t 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 a418fcda..bad12b3f 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 i64TimeOfDay =0; + int64_t 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 dfdea93e..d6f81a60 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 min, __int64 max) +void UIControl_SpaceIndicatorBar::init(const wstring &label, int id, int64_t min, int64_t max) { m_label = label; m_id = id; @@ -61,11 +61,11 @@ void UIControl_SpaceIndicatorBar::reset() setSaveGameOffset(0.0f); } -void UIControl_SpaceIndicatorBar::addSave(__int64 size) +void UIControl_SpaceIndicatorBar::addSave(int64_t size) { float startPercent = (float)((m_currentTotal-m_min))/(m_max-m_min); - m_sizeAndOffsets.push_back( pair<__int64, float>(size, startPercent) ); + m_sizeAndOffsets.push_back( pair(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<__int64,float> values = m_sizeAndOffsets[index]; + pair 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 size) +void UIControl_SpaceIndicatorBar::setSaveSize(int64_t size) { m_currentSave = size; @@ -99,7 +99,7 @@ void UIControl_SpaceIndicatorBar::setSaveSize(__int64 size) IggyResult out = IggyPlayerCallMethodRS ( m_parentScene->getMovie() , &result, getIggyValuePath() , m_setSaveSizeFunc , 1 , value ); } -void UIControl_SpaceIndicatorBar::setTotalSize(__int64 size) +void UIControl_SpaceIndicatorBar::setTotalSize(int64_t 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 39f9a746..08e00da9 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 m_min; - __int64 m_max; - __int64 m_currentSave, m_currentTotal; + int64_t m_min; + int64_t m_max; + int64_t 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 min, __int64 max); + void init(const wstring &label, int id, int64_t min, int64_t max); virtual void ReInit(); void reset(); - void addSave(__int64 size); + void addSave(int64_t size); void selectSave(int index); private: - void setSaveSize(__int64 size); - void setTotalSize(__int64 totalSize); + void setSaveSize(int64_t size); + void setTotalSize(int64_t 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 eb33b6b3..34afbc71 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 UIController::iggyAllocCount = 0; +int64_t 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 currentTime = System::currentTimeMillis(); + int64_t 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 totalStatic = 0; + int64_t 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 targetTime = System::currentTimeMillis() + (1000LL * 60); + int64_t 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 ef064f80..f8f695bd 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 iggyAllocCount; + static int64_t 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 m_expiry; + int64_t 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 1899d05b..ed9d06b1 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 &totalStatic, __int64 &totalDynamic) + +void UIGroup::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 groupStatic = 0; - __int64 groupDynamic = 0; + int64_t groupStatic = 0; + int64_t 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 e20fbb02..8e16c2c3 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 &totalStatic, __int64 &totalDynamic); + + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &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 15bde2fa..6acfc85f 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 &totalStatic, __int64 &totalDynamic) +void UILayer::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { - __int64 layerStatic = 0; - __int64 layerDynamic = 0; + int64_t layerStatic = 0; + int64_t 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 &totalStatic, __int64 &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 2840f23f..357c2874 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 &totalStatic, __int64 &totalDynamic); + + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic); }; diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index e7d907ec..75eb3dcf 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 beforeLoad = ui.iggyAllocCount; + int64_t beforeLoad = ui.iggyAllocCount; swf = IggyPlayerCreateFromMemory ( baFile.data , baFile.length, NULL); - __int64 afterLoad = ui.iggyAllocCount; - IggyPlayerInitializeAndTickRS ( swf ); - __int64 afterTick = ui.iggyAllocCount; + int64_t afterLoad = ui.iggyAllocCount; + IggyPlayerInitializeAndTickRS ( swf ); + int64_t 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 totalStatic = 0; - __int64 totalDynamic = 0; + int64_t totalStatic = 0; + int64_t 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 &totalStatic, __int64 &totalDynamic) +void UIScene::PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &totalDynamic) { if(!swf) return; IggyMemoryUseInfo memoryInfo; rrbool res; int iteration = 0; - __int64 sceneStatic = 0; - __int64 sceneDynamic = 0; + int64_t sceneStatic = 0; + int64_t 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 823c510c..1b646ce0 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 &totalStatic, __int64 &totalDynamic); + void PrintTotalMemoryUsage(int64_t &totalStatic, int64_t &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 6be67bed..0c415c7b 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 seedValue = 0; + int64_t seedValue = 0; NetworkGameInitData *param = new NetworkGameInitData(); if (wSeed.length() != 0) { - __int64 value = 0; + int64_t 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<__int64>(wSeed); + value = _fromString(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 e45fa09c..c3e0ca1c 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 m_seed; + int64_t 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 1d90da77..166c708d 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 fileSize = saveFile->length(); + int64_t 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 fileSize = cloudFile.length(); + int64_t 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 b3608b06..b949aafa 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 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_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 if (wSeed.length() != 0) { - __int64 value = 0; + int64_t 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<__int64>(wSeed); + value = _fromString(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 73f25da5..142e8ba1 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 fileSize = saveFile->length(); + int64_t 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 03782c79..1a679f58 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 i64TimeOfDay =0; + int64_t 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 9987a775..8fd83696 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 __int64 +# define z_off64_t long long # else # define z_off64_t z_off_t # endif diff --git a/Minecraft.Client/CreateWorldScreen.cpp b/Minecraft.Client/CreateWorldScreen.cpp index b9856c7e..1a897203 100644 --- a/Minecraft.Client/CreateWorldScreen.cpp +++ b/Minecraft.Client/CreateWorldScreen.cpp @@ -97,14 +97,14 @@ void CreateWorldScreen::buttonClicked(Button *button) if (done) return; done = true; - __int64 seedValue = (new Random())->nextLong(); + int64_t seedValue = (new Random())->nextLong(); wstring seedString = seedEdit->getValue(); if (seedString.length() != 0) { // try to convert it to a long first // try { // 4J - removed try/catch - __int64 value = _fromString<__int64>(seedString); + int64_t value = _fromString(seedString); if (value != 0) { seedValue = value; diff --git a/Minecraft.Client/DemoLevel.h b/Minecraft.Client/DemoLevel.h index 8364d5b4..6464c32b 100644 --- a/Minecraft.Client/DemoLevel.h +++ b/Minecraft.Client/DemoLevel.h @@ -4,7 +4,7 @@ class DemoLevel : public Level { private: - static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); + static const int64_t DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; static const int DEMO_SPAWN_Z = -731; diff --git a/Minecraft.Client/DemoMode.cpp b/Minecraft.Client/DemoMode.cpp index 3b24af7a..0816023b 100644 --- a/Minecraft.Client/DemoMode.cpp +++ b/Minecraft.Client/DemoMode.cpp @@ -13,8 +13,8 @@ void DemoMode::tick() SurvivalMode::tick(); /* 4J - TODO - seems unlikely we need this demo mode anyway - __int64 time = minecraft->level->getTime(); - __int64 day = (time / Level::TICKS_PER_DAY) + 1; + int64_t time = minecraft->level->getTime(); + int64_t day = (time / Level::TICKS_PER_DAY) + 1; demoHasEnded = (time > (500 + Level::TICKS_PER_DAY * DEMO_DAYS)); if (demoHasEnded) @@ -26,7 +26,7 @@ void DemoMode::tick() { if (day <= (DEMO_DAYS + 1)) { - minecraft->gui->displayClientMessage(L"demo.day." + _toString<__int64>(day)); + minecraft->gui->displayClientMessage(L"demo.day." + _toString(day)); } } else if (day == 1) diff --git a/Minecraft.Client/Durango/Durango_App.cpp b/Minecraft.Client/Durango/Durango_App.cpp index 2ec81a29..e377ba05 100644 --- a/Minecraft.Client/Durango/Durango_App.cpp +++ b/Minecraft.Client/Durango/Durango_App.cpp @@ -50,7 +50,7 @@ void CConsoleMinecraftApp::HandleDLCLicenseChange() // Clear the DLC installed flag so the scenes will pick up the new dlc (could be a full pack install) app.ClearDLCInstalled(); app.DebugPrintf(">>> HandleDLCLicenseChange - Updating license for DLC [%ls]\n",xOffer.wszOfferName); - pack->updateLicenseMask(1); + pack->updateLicenseMask(1); } else { @@ -100,7 +100,7 @@ void CConsoleMinecraftApp::ExitGame() } void CConsoleMinecraftApp::FatalLoadError() { - // 4J-PB - + // 4J-PB - //for(int i=0;i<10;i++) { #ifndef _CONTENT_PACKAGE @@ -204,7 +204,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(WCHAR *wchName,PBYTE *ppbImageData,D // load the local file WCHAR wchFilename[64]; - + // 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds swprintf(wchFilename,L"DLCImages/%s",wchName); HANDLE hFile = CreateFile(wchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -269,7 +269,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 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_t seedValue = 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 NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -308,7 +308,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() thread->Run(); } -typedef struct +typedef struct { eDLCContentType e_DLC_Type; //WCHAR *wchDisplayName; @@ -397,7 +397,7 @@ bool CConsoleMinecraftApp::UpdateProductId(XCONTENT_DATA &Data) app.DebugPrintf("Couldn't find %ls\n",Data.wszDisplayName); } - return false; + return false; } void CConsoleMinecraftApp::Shutdown() @@ -455,7 +455,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in { app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPReadBannedList\n"); C4JStorage::PTMSPP_FILEDATA pFileData=(C4JStorage::PTMSPP_FILEDATA)lpvData; - + CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; if(pFileData) @@ -471,7 +471,7 @@ int CConsoleMinecraftApp::Callback_TMSPPReadBannedList(void *pParam,int iPad, in // mark the level as not checked against banned levels - it'll be checked once the level starts app.SetBanListCheck(iPad,false); - // Xbox One will clear things within the DownloadBlob + // Xbox One will clear things within the DownloadBlob #ifndef _XBOX_ONE delete [] pFileData->pbData; delete [] pFileData; @@ -558,11 +558,11 @@ int CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList(void *pParam,int iPad, CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; app.DebugPrintf("CConsoleMinecraftApp::Callback_TMSPPRetrieveFileList\n"); if(lpvData!=NULL) - { + { vector *pvTmsFileDetails=(vector *)lpvData; if(pvTmsFileDetails->size()>0) - { + { #ifdef _DEBUG // dump out the file list app.DebugPrintf("TMSPP filecount - %d\nFiles - \n",pvTmsFileDetails->size()); @@ -707,7 +707,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: { CConsoleMinecraftApp* pClass = (CConsoleMinecraftApp*)pParam; - if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota + if ( saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfQuota || saveIncompleteType == C4JStorage::ESaveIncomplete_OutOfLocalStorage ) { StorageManager.SetSaveDisabled(true); @@ -718,10 +718,10 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: else message = IDS_SAVE_INCOMPLETE_EXPLANATION_LOCAL_STORAGE; UINT uiIDA[3] = - { - IDS_SAVE_INCOMPLETE_RETRY_SAVING, - IDS_SAVE_INCOMPLETE_DISABLE_SAVING, - IDS_SAVE_INCOMPLETE_DELETE_SAVES + { + IDS_SAVE_INCOMPLETE_RETRY_SAVING, + IDS_SAVE_INCOMPLETE_DISABLE_SAVING, + IDS_SAVE_INCOMPLETE_DELETE_SAVES }; if ( ui.RequestMessageBox( IDS_SAVE_INCOMPLETE_TITLE, message, uiIDA,3,0,Callback_SaveGameIncompleteMessageBoxReturned,pClass, app.GetStringTable()) == C4JStorage::EMessage_Busy) diff --git a/Minecraft.Client/Durango/Iggy/include/rrCore.h b/Minecraft.Client/Durango/Iggy/include/rrCore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/Durango/Iggy/include/rrCore.h +++ b/Minecraft.Client/Durango/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Durango/Miles/include/mss.h b/Minecraft.Client/Durango/Miles/include/mss.h index 531dcbc9..754f536b 100644 --- a/Minecraft.Client/Durango/Miles/include/mss.h +++ b/Minecraft.Client/Durango/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef uint64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the byte size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/Durango/Miles/include/rrCore.h b/Minecraft.Client/Durango/Miles/include/rrCore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/Durango/Miles/include/rrCore.h +++ b/Minecraft.Client/Durango/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp index f13cc4aa..eaa8d400 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.cpp @@ -43,7 +43,7 @@ DQRNetworkManager::SessionInfo::SessionInfo() } // This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type -const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] = +const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTStateMappings[DQRNetworkManager::DNM_INT_STATE_COUNT] = { DNM_STATE_INITIALISING, // DNM_INT_STATE_INITIALISING DNM_STATE_INITIALISE_FAILED, // DNM_INT_STATE_INITIALISE_FAILED @@ -64,7 +64,7 @@ const DQRNetworkManager::eDQRNetworkManagerState DQRNetworkManager::m_INTtoEXTSt DNM_STATE_PLAYING, // DNM_INT_STATE_PLAYING DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING DNM_STATE_LEAVING, // DNM_INT_STATE_LEAVING_FAILED - DNM_STATE_ENDING, // DNM_INT_STATE_ENDING + DNM_STATE_ENDING, // DNM_INT_STATE_ENDING }; DQRNetworkManager::DQRNetworkManager(IDQRNetworkManagerListener *listener) @@ -146,7 +146,7 @@ void DQRNetworkManager::EnableDebugXBLContext(MXS::XboxLiveContext^ XBLContext) // Show service calls from Xbox Services on the UI for easy debugging XBLContext->Settings->EnableServiceCallRoutedEvents = true; - XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler( + XBLContext->Settings->ServiceCallRouted += ref new Windows::Foundation::EventHandler( [=]( Platform::Object^, Microsoft::Xbox::Services::XboxServiceCallRoutedEventArgs^ args ) { //if( args->HttpStatus != 200 ) @@ -308,14 +308,14 @@ void DQRNetworkManager::JoinSession(int playerMask) m_isHosting = false; sockaddr_in6 localSocketAddressStorage; - + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); - + localSocketAddressStorage.sin6_family = AF_INET6; localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); - + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); m_joinCreateSessionAttempts = 0; @@ -402,7 +402,7 @@ bool DQRNetworkManager::AddUsersToSession(int playerMask, MXSM::MultiplayerSessi // We need to get a MultiplayerSession for each player that is joining MXSM::MultiplayerSession^ session = nullptr; - + WXS::User^ newUser = ProfileManager.GetUser(i); if( newUser == nullptr ) { @@ -451,12 +451,12 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) // We need to handle this differently for the host and other machines. As the procedure for adding a reserved slot for a local player whilst on the host doesn't seem to work // // On the host machine, we: - // + // // (1) Get a MPSD for the player that is being added // (2) Call the join method // (3) Write the MPSD // (4) Update the player sync data, and broadcast out to all clients - + // On remote machines, we: // // (1) join the party @@ -473,10 +473,10 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) { return false; } - + if( !m_isOfflineGame ) { - // This is going to involve some async processing + // This is going to involve some async processing MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); if( newUserXBLContext == nullptr ) @@ -558,7 +558,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) SendRoomSyncInfo(); m_listener->HandlePlayerJoined(pPlayer); // This is for notifying of local players joining in an offline game } - else + else { // Can fail (notably if m_roomSyncData contains players who've left) assert(0); @@ -571,7 +571,7 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) { // Check if there's any available slots before attempting to add the player to the party. We can still fail joining later if // the host can't add a reserved slot for us for some reason but better checking on the client side before even attempting. - + WXS::User^ newUser = ProfileManager.GetUser(userIndex); MXS::XboxLiveContext^ newUserXBLContext = ref new MXS::XboxLiveContext(newUser); @@ -622,16 +622,16 @@ bool DQRNetworkManager::AddLocalPlayerByUserIndex(int userIndex) bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) { - // We need to handle this differently for the host and other machines. + // We need to handle this differently for the host and other machines. // // On the host machine, we: - // + // // (1) Get a MPSD for the player that is being removed // (2) Call the leave method // (3) Write the MPSD // (4) Leave the party // (5) Update the player sync data, and broadcast out to all clients - + // On remote machines, we: // // (1) Get a MPSD for the player that is being removed @@ -651,7 +651,7 @@ bool DQRNetworkManager::RemoveLocalPlayerByUserIndex(int userIndex) { return false; } - + if( !m_isOfflineGame ) { if( m_chat ) @@ -714,7 +714,7 @@ bool DQRNetworkManager::IsHost() } // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and // it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. bool DQRNetworkManager::IsInSession() { @@ -788,7 +788,7 @@ wstring DQRNetworkManager::GetDisplayNameByGamertag(wstring gamertag) { return m_displayNames[gamertag]; } - else + else { return gamertag; } @@ -902,14 +902,14 @@ void DQRNetworkManager::Tick_VoiceChat() { m_chat->AddLocalUser(user); } - } + } } m_vecChatPlayersJoined.clear(); LeaveCriticalSection(&m_csVecChatPlayers); } void DQRNetworkManager::Tick_Party() -{ +{ // If the primary player has been flagged as having left the party, then we don't respond immediately as it is possible we are just transitioning from one party to another, and it would be much // nicer to handle this kind of transition directly. If we do get a new party within this time period, then we'll handle by asking the user if they want to leave the game they are currently in etc. if( m_playersLeftParty ) @@ -919,7 +919,7 @@ void DQRNetworkManager::Tick_Party() // We've waited long enough. User must (hopefully) have just left the party // Previously we'd switch to offline but that causes a world of pain with forced sign-outs if( m_playersLeftParty & 1 ) - { + { // Before we switch to an offline game, check to see if there is currently a new party. If this is the case and // we're here, then its because we were added to a party, but didn't receive a gamesessionready event. So if we have // a party here that we've joined, and the number of players in the party (including us) is more than MAX_PLAYERS_IN_TEMPLATE, @@ -955,7 +955,7 @@ void DQRNetworkManager::Tick_Party() m_playersLeftParty = 0; } } - + // Forced sign out if (m_handleForcedSignOut) { @@ -1064,7 +1064,7 @@ void DQRNetworkManager::Tick_ResolveGamertags() HostGamertagResolveDetails *details = m_hostGamertagResolveResults.front(); details->m_pPlayer->SetName(details->m_name.c_str()); - + LogComment("Adding a player"); if( AddRoomSyncPlayer(details->m_pPlayer, details->m_sessionAddress, details->m_channel ) ) { @@ -1154,7 +1154,7 @@ void DQRNetworkManager::Tick_StateMachine() break; case DNM_INT_STATE_JOINING_SENDING_UNRELIABLE: { - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); // m_firstUnreliableSendTime of 0 indicates that we haven't tried sending an unreliable packet yet so need to send one and initialise things if( m_firstUnreliableSendTime == 0 ) { @@ -1188,7 +1188,7 @@ void DQRNetworkManager::Tick_StateMachine() { // Timeout if we've been waiting for reserved slots for our joining players for too long. This is most likely because the host doesn't have room for all the slots we wanted, and we weren't able to determine this // when we went to join the game (ie someone else was joining at the same time). At this point we need to remove any local players that did already join, from both the session and the party. - __int64 timeNow = System::currentTimeMillis(); + int64_t timeNow = System::currentTimeMillis(); if( ( timeNow - m_startedWaitingForReservationsTime ) > JOIN_RESERVATION_WAIT_TIME ) { SetState(DNM_INT_STATE_JOINING_FAILED_TIDY_UP); @@ -1332,7 +1332,7 @@ void DQRNetworkManager::HandleSessionChange(MXSM::MultiplayerSession^ multiplaye { ((DurangoStats*)GenericStats::getInstance())->setMultiplayerCorrelationId( nullptr ); } - + m_multiplayerSession = multiplayerSession; } @@ -1362,7 +1362,7 @@ MXSM::MultiplayerSession^ DQRNetworkManager::WriteSessionHelper( MXS::XboxLiveCo }) .wait(); - if( outputMultiplayerSession != nullptr && + if( outputMultiplayerSession != nullptr && outputMultiplayerSession->SessionReference != nullptr ) { app.DebugPrintf( "Session written OK\n" ); @@ -1422,7 +1422,7 @@ WXM::MultiplayerSessionReference^ DQRNetworkManager::ConvertToWindowsXboxMultipl { return ref new WXM::MultiplayerSessionReference( sessionRef->SessionName, - sessionRef->ServiceConfigurationId, + sessionRef->ServiceConfigurationId, sessionRef->SessionTemplateName ); } @@ -1458,7 +1458,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) // And when we are done, anything left in the temporary vector must be a player that left for( int i = 0; i < pNewSyncData->playerCount; i++ ) { - PlayerSyncData *pNewPlayer = &pNewSyncData->players[i]; + PlayerSyncData *pNewPlayer = &pNewSyncData->players[i]; bool bAlreadyExisted = false; for( AUTO_VAR(it, tempPlayers.begin()); it != tempPlayers.end(); it++ ) { @@ -1491,7 +1491,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) } LogCommentFormat(L"Adding new player, index %d - type %d, small Id %d, name %s, xuid %s\n",i,m_players[i]->m_type,pNewPlayer->m_smallId,pNewPlayer->m_name,pNewPlayer->m_XUID); - + m_players[i]->SetSmallId(pNewPlayer->m_smallId); m_players[i]->SetName(pNewPlayer->m_name); m_players[i]->SetUID(PlayerUID(pNewPlayer->m_XUID)); @@ -1525,7 +1525,7 @@ void DQRNetworkManager::UpdateRoomSyncPlayers(RoomSyncData *pNewSyncData) bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel) { if( m_roomSyncData.playerCount == MAX_ONLINE_PLAYER_COUNT ) return false; - + EnterCriticalSection(&m_csRoomSyncData); // Find the first entry that isn't us, to decide what to sync before. Don't consider entry #0 as this is reserved to indicate the host. int insertAtIdx = m_roomSyncData.playerCount; @@ -1552,11 +1552,11 @@ bool DQRNetworkManager::AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned in { m_roomSyncData.players[i] = m_roomSyncData.players[i-1]; m_players[i] = m_players[i - 1]; - } + } m_roomSyncData.players[insertAtIdx].m_channel = channel; m_roomSyncData.players[insertAtIdx].m_sessionAddress = sessionAddress; int xuidLength = pPlayer->GetUID().toString().length() + 1; // +1 for terminator - m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength]; + m_roomSyncData.players[insertAtIdx].m_XUID = new wchar_t [xuidLength]; wcsncpy(m_roomSyncData.players[insertAtIdx].m_XUID, pPlayer->GetUID().toString().c_str(), xuidLength); m_roomSyncData.players[insertAtIdx].m_smallId = pPlayer->GetSmallId(); wcscpy_s(m_roomSyncData.players[insertAtIdx].m_name, pPlayer->GetName()); @@ -1587,7 +1587,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayersWithSessionAddress(unsigned int ses { m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; m_players[iWriteIdx] = m_players[i]; - iWriteIdx++; + iWriteIdx++; } } m_roomSyncData.playerCount = iWriteIdx; @@ -1618,7 +1618,7 @@ void DQRNetworkManager::RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer) { m_roomSyncData.players[iWriteIdx] = m_roomSyncData.players[i]; m_players[iWriteIdx] = m_players[i]; - iWriteIdx++; + iWriteIdx++; } } m_roomSyncData.playerCount = iWriteIdx; @@ -1659,13 +1659,13 @@ void DQRNetworkManager::SendRoomSyncInfo() uint32_t sizeHigh = internalBytes >> 8; uint32_t sizeLow = internalBytes & 0xff; - data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself data[2] = DQR_INTERNAL_PLAYER_TABLE; memcpy(data + 3, &xuidBytes, 4); memcpy(data + 7, &m_roomSyncData, sizeof(RoomSyncData)); - unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData); + unsigned char *pucCurr = data + 7 + sizeof(RoomSyncData); for( int i = 0 ; i < m_roomSyncData.playerCount; i++ ) { @@ -1701,12 +1701,12 @@ void DQRNetworkManager::SendAddPlayerFailed(Platform::String^ xuid) uint32_t sizeHigh = internalBytes >> 8; uint32_t sizeLow = internalBytes & 0xff; - data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending + data[0] = 0x80 | sizeHigh; // Header - flag as internal data (0x80), sending data[1] = sizeLow; // Data following has the a single byte to say what it is, followed by the room sync data itself data[2] = DQR_INTERNAL_ADD_PLAYER_FAILED; memcpy(data + 3, &xuidBytes, 4); - memcpy(data + 7, xuid->Data(), xuidBytes); + memcpy(data + 7, xuid->Data(), xuidBytes); SendBytesRaw(-1, data, totalBytes, true); @@ -1927,7 +1927,7 @@ int DQRNetworkManager::HostGameThreadProc() // Actually create the session (locally), using the primary player's context try { - session = ref new MXSM::MultiplayerSession( primaryUserXBLContext, + session = ref new MXSM::MultiplayerSession( primaryUserXBLContext, ref new MXSM::MultiplayerSessionReference( SERVICE_CONFIG_ID, MATCH_SESSION_TEMPLATE_NAME, sessionName ), 0, // this means that it will use the maxMembers specified in the session template. false, @@ -1972,7 +1972,7 @@ int DQRNetworkManager::HostGameThreadProc() session->Join( GetNextSmallIdAsJsonString(), true ); session->SetCurrentUserStatus( MXSM::MultiplayerSessionMemberStatus::Active ); - + // Get device ID for current user & set in the session Platform::String^ secureDeviceAddress = WXN::SecureDeviceAddress::GetLocal()->GetBase64String(); session->SetCurrentUserSecureDeviceAddressBase64( secureDeviceAddress ); @@ -1997,7 +1997,7 @@ int DQRNetworkManager::HostGameThreadProc() return 0; } m_partyController->SetJoinability(m_listener->IsSessionJoinable()); - + // Add reservations for anyone in the party, who isn't the primary player. Just adding local players for now, but perhaps this should add // other party members at this stage? for ( WXM::PartyMember^ member : partyView->Members ) @@ -2029,8 +2029,8 @@ int DQRNetworkManager::HostGameThreadProc() session->SetHostDeviceToken( hostMember->DeviceToken ); m_partyController->RegisterGamePlayersChangedEventHandler(); - - // Update session on the server + + // Update session on the server HRESULT hr = S_OK; session = WriteSessionHelper( primaryUserXBLContext, session, MXSM::MultiplayerSessionWriteMode::UpdateExisting, hr ); @@ -2086,14 +2086,14 @@ int DQRNetworkManager::HostGameThreadProc() if( m_state == DNM_INT_STATE_HOSTING_FAILED) return 0; sockaddr_in6 localSocketAddressStorage; - + ZeroMemory(&localSocketAddressStorage, sizeof(localSocketAddressStorage)); - + localSocketAddressStorage.sin6_family = AF_INET6; localSocketAddressStorage.sin6_port = htons(m_associationTemplate->AcceptorSocketDescription->BoundPortRangeLower); - + memcpy(&localSocketAddressStorage.sin6_addr, &in6addr_any, sizeof(in6addr_any)); - + m_localSocketAddress = Platform::ArrayReference(reinterpret_cast(&localSocketAddressStorage), sizeof(localSocketAddressStorage)); // This shouldn't ever happen, but seems worth checking that we don't have a pre-existing session in case there's any way to get here with one already running @@ -2184,7 +2184,7 @@ int DQRNetworkManager::HostGameThreadProc() if( m_currentUserMask & ( 1 << i ) && ProfileManager.IsSignedIn(i)) { auto user = ProfileManager.GetUser(i); - wstring displayName = ProfileManager.GetDisplayName(i); + wstring displayName = ProfileManager.GetDisplayName(i); DQRNetworkPlayer* pPlayer = new DQRNetworkPlayer(this, ( ( smallId == m_hostSmallId ) ? DQRNetworkPlayer::DNP_TYPE_HOST : DQRNetworkPlayer::DNP_TYPE_LOCAL ), true, i, localSessionAddress); pPlayer->SetSmallId(smallId); @@ -2234,7 +2234,7 @@ int DQRNetworkManager::LeaveRoomThreadProc() // Request RTS to be terminated RTS_Terminate(); - + // Now leave the game session. We need to do this for each player in turn, writing each time bool bError = false; for( int i = 0; i < 4; i++ ) @@ -2339,7 +2339,7 @@ int DQRNetworkManager::TidyUpJoinThreadProc() // We can fail to join at various points, and in at least one case (if it is down to RUDP unreliable packets timing out) then we don't have m_joinSessionUserMask bits set any more, // but we Do have m_currentUserMask set. Any of these should be considered users we should be attempting to remove from the session. - int removeSessionMask = m_joinSessionUserMask | m_currentUserMask; + int removeSessionMask = m_joinSessionUserMask | m_currentUserMask; for( int i = 0; i < 4; i++ ) { if( removeSessionMask & ( 1 << i ) ) @@ -2428,7 +2428,7 @@ int DQRNetworkManager::UpdateCustomSessionDataThreadProc() { LogComment(L"Starting thread to update custom data"); WXS::User^ primaryUser = ProfileManager.GetUser(0); - + if( primaryUser == nullptr ) { return 0; @@ -2550,7 +2550,7 @@ void DQRNetworkManager::HandlePlayerRemovedFromParty(int playerMask) { // As a client, we don't have any messy changing to offline game or saving etc. to do, so we can respond immediately to leaving the party if( playerMask & 1 ) - { + { DQRNetworkManager::LogComment(L"Primary player on this system has left the party - leaving game\n"); app.SetDisconnectReason(DisconnectPacket::eDisconnect_ExitedGame); LeaveRoom(); @@ -2725,7 +2725,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes m_joinSessionUserMask = playerMask; m_isInSession = true; m_isOfflineGame = false; - + m_startedWaitingForReservationsTime = System::currentTimeMillis(); SetState(DNM_INT_STATE_JOINING_WAITING_FOR_RESERVATIONS); @@ -2742,7 +2742,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes if( sessionRef != nullptr ) { // Allow 2 seconds before we let the player cancel - __int64 allowCancelTime = System::currentTimeMillis() + (1000 * 2); + int64_t allowCancelTime = System::currentTimeMillis() + (1000 * 2); // Now leave the game session. We need to do this for each player in turn, writing each time. Consider that any of the joining // members *may* have a slot (reserved or active) depending on how far progressed the joining got. @@ -2814,7 +2814,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes break; } - __int64 currentTime = System::currentTimeMillis(); + int64_t currentTime = System::currentTimeMillis(); if( currentTime > allowCancelTime) { shownCancelScreen = true; @@ -2893,7 +2893,7 @@ bool DQRNetworkManager::JoinPartyFromSearchResult(SessionSearchResult *searchRes SetState(DNM_INT_STATE_JOINING_FAILED); } }); - + while(!ccTask.is_done()) { @@ -3013,7 +3013,7 @@ void DQRNetworkManager::RequestDisplayName(DQRNetworkPlayer *player) { if (player->IsLocal()) { - // Player is local so we can just ask profile manager + // Player is local so we can just ask profile manager SetDisplayName(player->GetUID(), ProfileManager.GetDisplayName(player->GetLocalPlayerIndex())); } else diff --git a/Minecraft.Client/Durango/Network/DQRNetworkManager.h b/Minecraft.Client/Durango/Network/DQRNetworkManager.h index 5f7b8d90..3c4a742c 100644 --- a/Minecraft.Client/Durango/Network/DQRNetworkManager.h +++ b/Minecraft.Client/Durango/Network/DQRNetworkManager.h @@ -131,7 +131,7 @@ public: static const int MAX_ONLINE_PLAYER_COUNT = 8; static const int MAX_ONLINE_PLAYER_NAME_LENGTH = 21; - // This class stores everything about a player that must be synchronised between machines. + // This class stores everything about a player that must be synchronised between machines. class PlayerSyncData { public: @@ -210,7 +210,7 @@ public: DNM_STATE_JOINING, DNM_STATE_STARTING, - DNM_STATE_PLAYING, + DNM_STATE_PLAYING, DNM_STATE_LEAVING, DNM_STATE_ENDING, @@ -339,9 +339,9 @@ private: static const eDQRNetworkManagerState m_INTtoEXTStateMappings[DNM_INT_STATE_COUNT]; eDQRNetworkManagerInternalState m_state; eDQRNetworkManagerState m_stateExternal; - __int64 m_lastUnreliableSendTime; - __int64 m_firstUnreliableSendTime; - __int64 m_startedWaitingForReservationsTime; + int64_t m_lastUnreliableSendTime; + int64_t m_firstUnreliableSendTime; + int64_t m_startedWaitingForReservationsTime; unsigned char *m_customSessionData; unsigned int m_customSessionDataSize; int m_customDataDirtyUpdateTicks; @@ -361,7 +361,7 @@ private: CRITICAL_SECTION m_csRoomSyncData; RoomSyncData m_roomSyncData; - DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT]; + DQRNetworkPlayer *m_players[MAX_ONLINE_PLAYER_COUNT]; IDQRNetworkManagerListener *m_listener; PartyController *m_partyController; @@ -389,7 +389,7 @@ private: int m_joinCreateSessionAttempts; C4JThread *m_CreateSessionThread; - C4JThread *m_LeaveRoomThread; + C4JThread *m_LeaveRoomThread; C4JThread *m_TidyUpJoinThread; C4JThread *m_UpdateCustomSessionDataThread; C4JThread *m_RTS_DoWorkThread; @@ -426,7 +426,7 @@ private: int GetQueueSizeMessages(); void SendBytesRaw(int smallId, BYTE *bytes, int byteCount, bool reliableAndSequential); void SendBytesChat(unsigned int address, BYTE *bytes, int byteCount, bool reliable, bool sequential, bool broadcast); - + bool AddRoomSyncPlayer(DQRNetworkPlayer *pPlayer, unsigned int sessionAddress, int channel); void RemoveRoomSyncPlayersWithSessionAddress(unsigned int sessionAddress); void RemoveRoomSyncPlayer(DQRNetworkPlayer *pPlayer); @@ -438,7 +438,7 @@ private: int GetSessionIndexForSmallId(unsigned char smallId); int GetSessionIndexAndSmallIdForHost(unsigned char *smallId); - static void LogComment( Platform::String^ strText ); + static void LogComment( Platform::String^ strText ); static void LogCommentFormat( LPCWSTR strMsg, ... ); static void LogCommentWithError( Platform::String^ strTest, HRESULT hr ); @@ -491,7 +491,7 @@ public: void SetDisplayName(PlayerUID xuid, wstring displayName); private: - __int64 m_playersLeftPartyTime; + int64_t m_playersLeftPartyTime; int m_playersLeftParty; bool GetBestPartyUserIndex(); @@ -502,7 +502,7 @@ private: bool GetGameSessionData(MXSM::MultiplayerSession^ session, void *gameSessionData); public: - static Platform::Collections::Vector^ GetFriends(); + static Platform::Collections::Vector^ GetFriends(); private: SessionSearchResult *m_sessionSearchResults; @@ -551,7 +551,7 @@ private: void Process_RTS_MESSAGE_STATUS_TERMINATED(RTS_Message &message); // Outgoing messages - to be called from the RTS work thread, to process requests from the main thread - + void ProcessRTSMessagesOutgoing(); void Process_RTS_MESSAGE_START_CLIENT(RTS_Message &message); void Process_RTS_MESSAGE_START_HOST(RTS_Message &message); diff --git a/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h b/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h index 5fc80438..ed0360f3 100644 --- a/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h +++ b/Minecraft.Client/Durango/ServiceConfig/Events-XBLA.8-149E11AEEvents.h @@ -155,12 +155,12 @@ Routine Description: Register the provider with ETW+. Arguments: - + None Remarks: - ERROR_SUCCESS if success or if the provider was already registered. + ERROR_SUCCESS if success or if the provider was already registered. Otherwise, an error code. --*/ @@ -175,7 +175,7 @@ Routine Description: Arguments: None Remarks: - ERROR_SUCCESS if success or if the provider was not registered. + ERROR_SUCCESS if success or if the provider was not registered. Otherwise, an error code. --*/ #define EventUnregisterXBLA_149E11AE() EtxUnregister(&XBLA_149E11AEProvider, &XBLA_149E11AEHandle) @@ -265,7 +265,7 @@ EventWriteBanLevel(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in co // __inline ULONG -EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const uint64_t BlockCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_BlockBroken 7 @@ -289,7 +289,7 @@ EventWriteBlockBroken(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // __inline ULONG -EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const unsigned __int64 BlockCount) +EventWriteBlockPlaced(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const signed int BlockId, __in const signed int BlockAux, __in const uint64_t BlockCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_BlockPlaced 7 @@ -376,7 +376,7 @@ EventWriteGameProgress(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __i // __inline ULONG -EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 Distance, __in const signed int TravelMethodId) +EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const uint64_t Distance, __in const signed int TravelMethodId) { #define ARGUMENT_COUNT_XBLA_149E11AE_IncDistanceTravelled 6 @@ -399,7 +399,7 @@ EventWriteIncDistanceTravelled(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessio // __inline ULONG -EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const unsigned __int64 TimePlayed) +EventWriteIncTimePlayed(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in const signed int DifficultyLevelId, __in const uint64_t TimePlayed) { #define ARGUMENT_COUNT_XBLA_149E11AE_IncTimePlayed 5 @@ -570,7 +570,7 @@ EventWriteLevelStart(__in_opt PCWSTR UserId, __in LPCGUID PlayerSessionId, __in // __inline ULONG -EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount) +EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const signed int AcquisitionMethodId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const uint64_t ItemCount) { #define ARGUMENT_COUNT_XBLA_149E11AE_McItemAcquired 14 @@ -601,7 +601,7 @@ EventWriteMcItemAcquired(__in_opt PCWSTR UserId, __in const signed int SectionId // __inline ULONG -EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const unsigned __int64 ItemCount, __in const signed int Hunger) +EventWriteMcItemUsed(__in_opt PCWSTR UserId, __in const signed int SectionId, __in LPCGUID PlayerSessionId, __in_opt PCWSTR MultiplayerCorrelationId, __in const signed int GameplayModeId, __in const signed int DifficultyLevelId, __in const signed int ItemId, __in const float LocationX, __in const float LocationY, __in const float LocationZ, __in const signed int ItemAux, __in const uint64_t ItemCount, __in const signed int Hunger) { #define ARGUMENT_COUNT_XBLA_149E11AE_McItemUsed 14 diff --git a/Minecraft.Client/Durango/XML/ATGXmlParser.cpp b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp index fc5aed08..771ba268 100644 --- a/Minecraft.Client/Durango/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Durango/XML/ATGXmlParser.cpp @@ -1,13 +1,13 @@ -// 4J-PB - -// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). -// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. -// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. -// You are encouraged to incorporate this code into your titles. +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. //------------------------------------------------------------------------------------- // AtgXmlParser.cpp -// +// // Simple callback non-validating XML parser implementation. // // Xbox Advanced Technology Group. @@ -35,7 +35,7 @@ XMLParser::XMLParser() // Name: XMLParser::~XMLParser //------------------------------------------------------------------------------------- XMLParser::~XMLParser() -{ +{ } @@ -51,11 +51,11 @@ VOID XMLParser::FillBuffer() if( m_hFile == NULL ) { - if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) + if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) NChars = XML_READ_BUFFER_SIZE; else NChars = m_uInXMLBufferCharsLeft; - + CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars ); m_uInXMLBufferCharsLeft -= NChars; m_pInXMLBuffer += NChars; @@ -69,7 +69,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; @@ -89,7 +89,7 @@ VOID XMLParser::SkipNextAdvance() //------------------------------------------------------------------------------------- // Name: XMLParser::ConsumeSpace -// Desc: Skips spaces in the current stream +// Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- HRESULT XMLParser::ConsumeSpace() { @@ -104,29 +104,29 @@ HRESULT XMLParser::ConsumeSpace() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - } - SkipNextAdvance(); + } + SkipNextAdvance(); return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::ConvertEscape -// Desc: Copies and converts an escape sequence into m_pWriteBuf +// Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- HRESULT XMLParser::ConvertEscape() -{ +{ HRESULT hr; WCHAR wVal = 0; - + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - // all escape sequences start with &, so ignore the first character - + // all escape sequences start with &, so ignore the first character + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if ( m_Ch == '#' ) // character as hex or decimal { if( FAILED( hr = AdvanceCharacter() ) ) @@ -135,9 +135,9 @@ HRESULT XMLParser::ConvertEscape() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + while ( m_Ch != ';' ) - { + { wVal *= 16; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -151,11 +151,11 @@ HRESULT XMLParser::ConvertEscape() else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) ) { wVal += m_Ch - 'A' + 10; - } + } else { - Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); + return E_INVALID_XML_SYNTAX; } if( FAILED( hr = AdvanceCharacter() ) ) @@ -165,7 +165,7 @@ HRESULT XMLParser::ConvertEscape() else // decimal number { while ( m_Ch != ';' ) - { + { wVal *= 10; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -174,7 +174,7 @@ HRESULT XMLParser::ConvertEscape() } else { - Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); + Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); return E_INVALID_XML_SYNTAX; } @@ -187,7 +187,7 @@ HRESULT XMLParser::ConvertEscape() m_Ch = wVal; return S_OK; - } + } // must be an entity reference @@ -197,13 +197,13 @@ HRESULT XMLParser::ConvertEscape() SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) { - Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); + Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); return E_INVALID_XML_SYNTAX; } @@ -219,7 +219,7 @@ HRESULT XMLParser::ConvertEscape() wVal = '"'; else { - Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); + Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence } @@ -228,10 +228,10 @@ HRESULT XMLParser::ConvertEscape() if( m_Ch != ';' ) { - Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); + Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ; } - + m_Ch = wVal; return S_OK; } @@ -250,41 +250,41 @@ HRESULT XMLParser::AdvanceAttrVal() return hr; if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) ) - { - Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); + { + Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); return E_INVALID_XML_SYNTAX; } wQuoteChar = m_Ch; - + for( ;; ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - else if( m_Ch == wQuoteChar ) - break; + return hr; + else if( m_Ch == wQuoteChar ) + break; else if( m_Ch == '&' ) { SkipNextAdvance(); if( FAILED( hr = ConvertEscape() ) ) - return hr; + return hr; } - else if( m_Ch == '<' ) + else if( m_Ch == '<' ) { - Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); + return E_INVALID_XML_SYNTAX; } - + // copy character into the buffer - - if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; } - + *m_pWritePtr = m_Ch; - m_pWritePtr++; + m_pWritePtr++; } return S_OK; } @@ -296,18 +296,18 @@ HRESULT XMLParser::AdvanceAttrVal() // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceName() -{ +{ HRESULT hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) && ( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) && ( m_Ch != '_' ) && ( m_Ch != ':' ) ) { - Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); + return E_INVALID_XML_SYNTAX; } while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) || @@ -319,17 +319,17 @@ HRESULT XMLParser::AdvanceName() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); return E_INVALID_XML_SYNTAX; - } + } *m_pWritePtr = m_Ch; m_pWritePtr++; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } - + SkipNextAdvance(); return S_OK; } @@ -343,7 +343,7 @@ HRESULT XMLParser::AdvanceName() // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) -{ +{ if( m_bSkipNextAdvance ) { m_bSkipNextAdvance = FALSE; @@ -351,20 +351,20 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } // If we hit EOF in the middle of a character, - // it's ok-- we'll just have a corrupt last character + // it's ok-- we'll just have a corrupt last character // (the buffer is padded with double NULLs ) if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { // Read more from the file - FillBuffer(); + FillBuffer(); // We are at EOF if it is still NULL if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { if( !bOkToFail ) { - Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); + Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); return E_INVALID_XML_SYNTAX; } else @@ -372,7 +372,7 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) return E_FAIL; } } - } + } if( m_bUnicode == FALSE ) { @@ -382,13 +382,13 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) else // if( m_bUnicode == TRUE ) { m_Ch = *((WCHAR *)m_pReadPtr); - + if( m_bReverseBytes ) { m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 ); } - - m_pReadPtr += 2; + + m_pReadPtr += 2; } if( m_Ch == '\n' ) @@ -398,114 +398,114 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } else if( m_Ch != '\r' ) m_pISAXCallback->m_LinePos++; - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::AdvanceElement -// Desc: Builds data, calls callback +// Desc: Builds data, calls callback //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceElement() -{ +{ HRESULT hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // if first character wasn't '<', we wouldn't be here - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch == '!' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if ( m_Ch == '-' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - if( m_Ch != '-' ) + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '-' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '-' after 'ElementEnd( pEntityRefVal, + if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if( m_Ch != '>' ) { @@ -513,42 +513,42 @@ HRESULT XMLParser::AdvanceElement() return E_INVALID_XML_SYNTAX; } } - else if( m_Ch == '?' ) + else if( m_Ch == '?' ) { // just skip any xml header tag since not really important after identifying character set for( ;; ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == '>' ) return S_OK; } } else { - XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; + XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; UINT NumAttrs; WCHAR *pEntityRefVal = m_pWritePtr; UINT EntityRefLen; NumAttrs = 0; - + SkipNextAdvance(); // Entity tag - if( FAILED( hr = AdvanceName() ) ) + if( FAILED( hr = AdvanceName() ) ) return hr; EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); - if( FAILED( hr = ConsumeSpace() ) ) + if( FAILED( hr = ConsumeSpace() ) ) return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // read attributes while( ( m_Ch != '>' ) && ( m_Ch != '/' ) ) { @@ -556,31 +556,31 @@ HRESULT XMLParser::AdvanceElement() if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT ) { - Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); + return E_INVALID_XML_SYNTAX; } Attributes[ NumAttrs ].strName = m_pWritePtr; - + // Attribute name if( FAILED( hr = AdvanceName() ) ) return hr; - + Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; - if( m_Ch != '=' ) + if( m_Ch != '=' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" ); return E_INVALID_XML_SYNTAX; } - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; Attributes[ NumAttrs ].strValue = m_pWritePtr; @@ -588,29 +588,29 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; - + if( FAILED( hr = ConsumeSpace() ) ) - return hr; + return hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } if( m_Ch == '/' ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch != '>' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" ); return E_INVALID_XML_SYNTAX; } - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; @@ -619,7 +619,7 @@ HRESULT XMLParser::AdvanceElement() } else { - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; } @@ -637,7 +637,7 @@ HRESULT XMLParser::AdvanceCDATA() { HRESULT hr; WORD wStage = 0; - + if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -645,10 +645,10 @@ HRESULT XMLParser::AdvanceCDATA() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( ( m_Ch == ']' ) && ( wStage == 0 ) ) wStage = 1; else if( ( m_Ch == ']' ) && ( wStage == 1 ) ) @@ -666,9 +666,9 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; - } + } } - + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) return E_ABORT; @@ -676,7 +676,7 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAEnd() ) ) return E_ABORT; - + return S_OK; } @@ -694,24 +694,24 @@ HRESULT XMLParser::AdvanceComment() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if (( m_Ch == '-' ) && ( wStage == 0 )) wStage = 1; else if (( m_Ch == '-' ) && ( wStage == 1 )) wStage = 2; - else if (( m_Ch == '>' ) && ( wStage == 2 )) - break; + else if (( m_Ch == '>' ) && ( wStage == 2 )) + break; else - wStage = 0; + wStage = 0; } - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::RegisterSAXCallbackInterface -// Desc: Registers callback interface +// Desc: Registers callback interface //------------------------------------------------------------------------------------- VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { @@ -721,7 +721,7 @@ VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) //------------------------------------------------------------------------------------- // Name: XMLParser::GetSAXCallbackInterface -// Desc: Returns current callback interface +// Desc: Returns current callback interface //------------------------------------------------------------------------------------- ISAXCallback* XMLParser::GetSAXCallbackInterface() { @@ -740,7 +740,7 @@ HRESULT XMLParser::MainParseLoop() if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; - + m_pWritePtr = m_pWriteBuf; FillBuffer(); @@ -751,57 +751,57 @@ HRESULT XMLParser::MainParseLoop() m_bReverseBytes = FALSE; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = TRUE; m_bReverseBytes = TRUE; - m_pReadPtr += 2; + m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) - { - m_bUnicode = TRUE; - m_bReverseBytes = FALSE; - } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) { m_bUnicode = TRUE; - m_bReverseBytes = TRUE; + m_bReverseBytes = FALSE; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; } else if ( m_pReadBuf[ 0 ] == 0x3C ) { - m_bUnicode = FALSE; - m_bReverseBytes = FALSE; + m_bUnicode = FALSE; + m_bReverseBytes = FALSE; } else - { + { Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" ); - return E_INVALID_XML_SYNTAX; + return E_INVALID_XML_SYNTAX; } - + for( ;; ) { if( FAILED( AdvanceCharacter( TRUE ) ) ) { if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } - + if( FAILED( m_pISAXCallback->EndDocument() ) ) return E_ABORT; - - return S_OK; + + return S_OK; } if( m_Ch == '<' ) { if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } @@ -810,45 +810,45 @@ HRESULT XMLParser::MainParseLoop() m_pWritePtr = m_pWriteBuf; - if( FAILED( hr = AdvanceElement() ) ) - return hr; + if( FAILED( hr = AdvanceElement() ) ) + return hr; m_pWritePtr = m_pWriteBuf; } - else + else { if( m_Ch == '&' ) { SkipNextAdvance(); - if( FAILED( hr = ConvertEscape() ) ) - return hr; + if( FAILED( hr = ConvertEscape() ) ) + return hr; } - if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && - ( m_Ch != '\t' ) ) + if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && + ( m_Ch != '\t' ) ) { bWhiteSpaceOnly = FALSE; } *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { if( !bWhiteSpaceOnly ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, + ( UINT ) ( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) { - return E_ABORT; + return E_ABORT; } } m_pWritePtr = m_pWriteBuf; bWhiteSpaceOnly = TRUE; } - } + } } } @@ -858,36 +858,36 @@ HRESULT XMLParser::MainParseLoop() // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) -{ +{ HRESULT hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; - m_pReadPtr = m_pReadBuf; - + m_pReadPtr = m_pReadBuf; + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; - + m_pReadBuf[ 1 ] = '\0'; + m_pInXMLBuffer = NULL; m_uInXMLBufferCharsLeft = 0; - + WCHAR wchFilename[ 64 ]; swprintf_s(wchFilename,64,L"%s",strFilename); - m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); + m_hFile = CreateFile( wchFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if( m_hFile == INVALID_HANDLE_VALUE ) - { + { Error( E_COULD_NOT_OPEN_FILE, "Error opening file" ); hr = E_COULD_NOT_OPEN_FILE; - + } else { @@ -897,14 +897,14 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) m_dwCharsConsumed = 0; hr = MainParseLoop(); } - + // Close the file if( m_hFile != INVALID_HANDLE_VALUE ) CloseHandle( m_hFile ); m_hFile = INVALID_HANDLE_VALUE; // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } @@ -914,38 +914,38 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) -{ +{ HRESULT hr; - + if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; m_pReadPtr = m_pReadBuf; - + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; m_hFile = NULL; m_pInXMLBuffer = strBuffer; m_uInXMLBufferCharsLeft = uBufferSize; m_dwCharsTotal = uBufferSize; m_dwCharsConsumed = 0; - + hr = MainParseLoop(); // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } //------------------------------------------------------------------------------------- -// XMLParser::Error() +// XMLParser::Error() // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation @@ -960,7 +960,7 @@ VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) va_start( pArglist, strFormat ); vsprintf( strBuffer, strFormat, pArglist ); - + m_pISAXCallback->Error( hErr, strBuffer ); va_end( pArglist ); } diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 508b3a1a..716d3307 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -178,7 +178,7 @@ GameRenderer::~GameRenderer() } void GameRenderer::tick(bool first) // 4J - add bFirst -{ +{ tickFov(); tickLightTexture(); // 4J - change brought forward from 1.8.2 fogBrO = fogBr; @@ -627,7 +627,7 @@ void GameRenderer::unZoomRegion() void GameRenderer::getFovAndAspect(float& fov, float& aspect, float a, bool applyEffects) { // 4J - split out aspect ratio and fov here so we can adjust for viewports - we might need to revisit these as - // they are maybe be too generous for performance. + // they are maybe be too generous for performance. aspect = mc->width / (float) mc->height; fov = getFov(a, applyEffects); @@ -679,7 +679,7 @@ void GameRenderer::setupCamera(float a, int eye) // 4J-PB - this is a per-player option //if (mc->options->bobView) bobView(a); - + bool bNoLegAnim =(mc->player->getAnimOverrideBitmask()&(1<player->getAnimOverrideBitmask()&(1<options->thirdPersonView && !mc->cameraTargetPlayer->isSleeping()) if (!localplayer->ThirdPersonView() && !mc->cameraTargetPlayer->isSleeping()) { - if (!mc->options->hideGui && !mc->gameMode->isCutScene()) + if (!mc->options->hideGui && !mc->gameMode->isCutScene()) { turnOnLightLayer(a); PIXBeginNamedEvent(0,"Item in hand render"); @@ -795,7 +795,7 @@ void GameRenderer::renderItemInHand(float a, int eye) // 4J - change brought forward from 1.8.2 void GameRenderer::turnOffLightLayer(double alpha) { // 4J - TODO -#if 0 +#if 0 if (SharedConstants::TEXTURE_LIGHTING) { glClientActiveTexture(GL_TEXTURE1); @@ -868,7 +868,7 @@ void GameRenderer::updateLightTexture(float a) if (player == NULL) continue; Level *level = player->level; // 4J - was mc->level when it was just to update the one light texture - + float skyDarken1 = level->getSkyDarken((float) 1); for (int i = 0; i < 256; i++) { @@ -1141,7 +1141,7 @@ int GameRenderer::runUpdate(LPVOID lpParam) Vec3::CreateNewThreadStorage(); AABB::CreateNewThreadStorage(); IntCache::CreateNewThreadStorage(); - Tesselator::CreateNewThreadStorage(1024*1024); + Tesselator::CreateNewThreadStorage(1024*1024); Compression::UseDefaultThreadStorage(); RenderManager.InitialiseContext(); #ifdef _LARGE_WORLDS @@ -1210,12 +1210,12 @@ int GameRenderer::runUpdate(LPVOID lpParam) } m_deleteStackSparseDataStorage.clear(); LeaveCriticalSection(&m_csDeleteStack); - + // PIXEndNamedEvent(); AABB::resetPool(); Vec3::resetPool(); - IntCache::Reset(); + IntCache::Reset(); m_updateEvents->Set(eUpdateEventIsFinished); } @@ -1247,12 +1247,12 @@ void GameRenderer::DisableUpdateThread() if( !updateRunning) return; app.DebugPrintf("------------------DisableUpdateThread--------------------\n"); updateRunning = false; - m_updateEvents->Clear(eUpdateCanRun); + m_updateEvents->Clear(eUpdateCanRun); m_updateEvents->WaitForSingle(eUpdateEventIsFinished,INFINITE); #endif } -void GameRenderer::renderLevel(float a, __int64 until) +void GameRenderer::renderLevel(float a, int64_t until) { // if (updateLightTexture) updateLightTexture(); // 4J - TODO - Java 1.0.1 has this line enabled, should check why - don't want to put it in now in case it breaks split-screen @@ -1335,7 +1335,7 @@ void GameRenderer::renderLevel(float a, __int64 until) if (until == 0) break; - __int64 diff = until - System::nanoTime(); + int64_t diff = until - System::nanoTime(); if (diff < 0) break; if (diff > 1000000000) break; } while (true); @@ -1594,7 +1594,7 @@ void GameRenderer::renderSnowAndRain(float a) this->turnOnLightLayer(a); - if (rainXa == NULL) + if (rainXa == NULL) { rainXa = new float[32 * 32]; rainZa = new float[32 * 32]; @@ -1657,7 +1657,7 @@ void GameRenderer::renderSnowAndRain(float a) } // 4J - some changes made here to access biome through new interface that caches results in levelchunk flags, as an optimisation - + int mode = -1; float time = _tick + a; @@ -1669,7 +1669,7 @@ void GameRenderer::renderSnowAndRain(float a) int rainSlot = (z - z0 + 16) * 32 + (x - x0 + 16); float xa = rainXa[rainSlot] * 0.5f; float za = rainZa[rainSlot] * 0.5f; - + // 4J - changes here brought forward from 1.8.2 Biome *b = level->getBiome(x, z); if (!b->hasRain() && !b->hasSnow()) continue; @@ -1715,9 +1715,9 @@ void GameRenderer::renderSnowAndRain(float a) float Alpha = ((1 - dd * dd) * 0.5f + 0.5f) * rainLevel; int tex2 = (level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4; t->tileRainQuad(x - xa + 0.5, yy0, z - za + 0.5, 0 * s, yy0 * s / 4.0f + ra * s, - x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s, - x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s, - x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s, + x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s, + x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s, + x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s, br, br, br, Alpha, br, br, br, 0, tex2); #else t->tex2(level->getLightColor(x, yl, z, 0)); @@ -1753,9 +1753,9 @@ void GameRenderer::renderSnowAndRain(float a) float Alpha = ((1 - dd * dd) * 0.3f + 0.5f) * rainLevel; int tex2 = (level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4; t->tileRainQuad(x - xa + 0.5, yy0, z - za + 0.5, 0 * s + uo, yy0 * s / 4.0f + ra * s + vo, - x + xa + 0.5, yy0, z + za + 0.5, 1 * s + uo, yy0 * s / 4.0f + ra * s + vo, - x + xa + 0.5, yy1, z + za + 0.5, 1 * s + uo, yy1 * s / 4.0f + ra * s + vo, - x - xa + 0.5, yy1, z - za + 0.5, 0 * s + uo, yy1 * s / 4.0f + ra * s + vo, + x + xa + 0.5, yy0, z + za + 0.5, 1 * s + uo, yy0 * s / 4.0f + ra * s + vo, + x + xa + 0.5, yy1, z + za + 0.5, 1 * s + uo, yy1 * s / 4.0f + ra * s + vo, + x - xa + 0.5, yy1, z - za + 0.5, 0 * s + uo, yy1 * s / 4.0f + ra * s + vo, br, br, br, Alpha, br, br, br, Alpha, tex2); #else t->tex2((level->getLightColor(x, yl, z, 0) * 3 + 0xf000f0) / 4); @@ -1861,7 +1861,7 @@ void GameRenderer::setupClearColor(float a) } else if (t != 0 && Tile::tiles[t]->material == Material::water) { - + unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Clear_Colour ); byte redComponent = ((colour>>16)&0xFF); byte greenComponent = ((colour>>8)&0xFF); @@ -1873,7 +1873,7 @@ void GameRenderer::setupClearColor(float a) } else if (t != 0 && Tile::tiles[t]->material == Material::lava) { - + unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Clear_Colour ); byte redComponent = ((colour>>16)&0xFF); byte greenComponent = ((colour>>8)&0xFF); @@ -2017,7 +2017,7 @@ void GameRenderer::setupFog(int i, float alpha) { glFogi(GL_FOG_MODE, GL_EXP); glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 - + unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_In_Cloud_Fog_Colour ); byte redComponent = ((colour>>16)&0xFF); byte greenComponent = ((colour>>8)&0xFF); @@ -2049,7 +2049,7 @@ void GameRenderer::setupFog(int i, float alpha) { glFogf(GL_FOG_DENSITY, 0.1f); // was 0.06 } - + unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Water_Fog_Colour ); byte redComponent = ((colour>>16)&0xFF); byte greenComponent = ((colour>>8)&0xFF); @@ -2074,7 +2074,7 @@ void GameRenderer::setupFog(int i, float alpha) { glFogi(GL_FOG_MODE, GL_EXP); glFogf(GL_FOG_DENSITY, 2.0f); // was 0.06 - + unsigned int colour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Under_Lava_Fog_Colour ); byte redComponent = ((colour>>16)&0xFF); byte greenComponent = ((colour>>8)&0xFF); diff --git a/Minecraft.Client/GameRenderer.h b/Minecraft.Client/GameRenderer.h index 3729726b..fca091a1 100644 --- a/Minecraft.Client/GameRenderer.h +++ b/Minecraft.Client/GameRenderer.h @@ -94,8 +94,8 @@ public: void setupCamera(float a, int eye); private: void renderItemInHand(float a, int eye); - __int64 lastActiveTime; - __int64 lastNsTime; + int64_t lastActiveTime; + int64_t lastNsTime; // 4J - changes brought forward from 1.8.2 bool _updateLightTexture; public: @@ -112,7 +112,7 @@ private: public: void render(float a, bool bFirst); // 4J added bFirst void renderLevel(float a); - void renderLevel(float a, __int64 until); + void renderLevel(float a, int64_t until); private: Random *random; int rainSoundTime; diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 7d76edbd..ffdf5055 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -58,7 +58,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { // 4J Stu - I have copied this code for XUI_BaseScene. If/when it gets changed it should be broken out // 4J - altered to force full screen mode to 3X scaling, and any split screen modes to 2X scaling. This is so that the further scaling by 0.5 that - // happens in split screen modes results in a final scaling of 1 rather than 1.5. + // happens in split screen modes results in a final scaling of 1 rather than 1.5. int splitYOffset;// = 20; // This offset is applied when doing the 2X scaling above to move the gui out of the way of the tool tips int guiScale;// = ( minecraft->player->m_iScreenSection == C4JRender::VIEWPORT_TYPE_FULLSCREEN ? 3 : 2 ); int iPad=minecraft->player->GetXboxPad(); @@ -97,7 +97,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) default: // 2 splitYOffset = 10; break; - } + } // Check which screen section this player is in switch(minecraft->player->m_iScreenSection) @@ -136,7 +136,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) currentGuiScaleFactor *= 0.5f; break; case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT: - iSafezoneXHalf = 0; + iSafezoneXHalf = 0; iSafezoneYHalf = splitYOffset + screenHeight/10;// 5% (need to treat the whole screen is 2x this screen) fScaleFactorHeight=0.5f; iHeightOffset=screenHeight; @@ -151,7 +151,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) currentGuiScaleFactor *= 0.5f; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT: - iSafezoneXHalf = 0; + iSafezoneXHalf = 0; iSafezoneYHalf = splitYOffset; // 5% iTooltipsYOffset=44; currentGuiScaleFactor *= 0.5f; @@ -163,27 +163,27 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) currentGuiScaleFactor *= 0.5f; break; case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT: - iSafezoneXHalf = 0; + iSafezoneXHalf = 0; iSafezoneYHalf = splitYOffset + screenHeight/10; // 5% (the whole screen is 2x this screen) iTooltipsYOffset=44; currentGuiScaleFactor *= 0.5f; break; - + } // 4J-PB - turn off the slot display if a xui menu is up, or if we're autosaving bool bDisplayGui=!ui.GetMenuDisplayed(iPad) && !(app.GetXuiAction(iPad)==eAppAction_AutosaveSaveGameCapturedThumbnail); // if tooltips are off, set the y offset to zero - if(app.GetGameSettings(iPad,eGameSetting_Tooltips)==0 && bDisplayGui) + if(app.GetGameSettings(iPad,eGameSetting_Tooltips)==0 && bDisplayGui) { switch(minecraft->player->m_iScreenSection) { case C4JRender::VIEWPORT_TYPE_FULLSCREEN: - iTooltipsYOffset=screenHeight/10; + iTooltipsYOffset=screenHeight/10; break; default: - //iTooltipsYOffset=screenHeight/10; + //iTooltipsYOffset=screenHeight/10; switch(guiScale) { case 3: @@ -195,11 +195,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) default: // 2 iTooltipsYOffset=14;//screenHeight/10; break; - } + } break; } } - + // 4J-PB - Turn off interface if eGameSetting_DisplayHUD is off - for screen shots/videos. if ( app.GetGameSettings(iPad,eGameSetting_DisplayHUD)==0 ) { @@ -210,13 +210,13 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) minecraft->gameRenderer->setupGuiScreen(guiScale); - + glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // 4J - added - this did actually get set in renderVignette but that code is currently commented out - if (Minecraft::useFancyGraphics()) + if (Minecraft::useFancyGraphics()) { renderVignette(minecraft->player->getBrightness(a), screenWidth, screenHeight); } @@ -244,7 +244,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if(bDisplayGui && bTwoPlayerSplitscreen) { // need to apply scale factors depending on the mode - glPushMatrix(); + glPushMatrix(); glScalef(fScaleFactorWidth, fScaleFactorHeight, fScaleFactorWidth); } #if RENDER_HUD @@ -308,9 +308,9 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // need to apply scale factors depending on the mode // 4J Stu - Moved this push and scale further up as we still need to do it for the few HUD components not replaced by xui - //glPushMatrix(); + //glPushMatrix(); //glScalef(fScaleFactorWidth, fScaleFactorHeight, fScaleFactorWidth); - + // 4J-PB - move into the safe zone, and account for 2 player splitscreen blit(iWidthOffset + (screenWidth - quickSelectWidth)/2, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset , 0, 0, 182, 22); blit(iWidthOffset + (screenWidth - quickSelectWidth)/2 - 1 + inventory->selected * 20, iHeightOffset + screenHeight - iSafezoneYHalf - iTooltipsYOffset - 1, 0, 22, 24, 22); @@ -358,13 +358,13 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) int food = foodData->getFoodLevel(); int oldFood = foodData->getLastFoodLevel(); -// if (false) //(true) +// if (false) //(true) // { // renderBossHealth(); // } ///////////////////////////////////////////////////////////////////////////////////// - // Display the experience, food, armour, health and the air bubbles + // Display the experience, food, armour, health and the air bubbles ///////////////////////////////////////////////////////////////////////////////////// if(bDisplayGui) { @@ -451,7 +451,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) if (blink) bg = 1; int xo = xLeft + i * 8; int yo = yLine1; - + if (iHealth <= 4) { yo += random->nextInt(2); @@ -538,12 +538,12 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glEnable(GL_RESCALE_NORMAL); Lighting::turnOnGui(); - + int x,y; for (int i = 0; i < 9; i++) - { + { if(bTwoPlayerSplitscreen) { x = iWidthOffset + screenWidth / 2 - 9 * 10 + i * 20 + 2; @@ -580,11 +580,11 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) else if( minecraft->player->isSprinting() ) { characterDisplayTimer[iPad] = 30; - } + } else if( minecraft->player->abilities.flying) { characterDisplayTimer[iPad] = 5; // quickly get rid of the player display if they stop flying - } + } else if( characterDisplayTimer[iPad] > 0 ) { --characterDisplayTimer[iPad]; @@ -670,7 +670,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) minecraft->player->onFire = 0; minecraft->player->setSharedFlag(Entity::FLAG_ONFIRE, false); - + glTranslatef(0, minecraft->player->heightOffset, 0); EntityRenderDispatcher::instance->playerRotY = 180; EntityRenderDispatcher::instance->isGuiRender = true; @@ -712,7 +712,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) { y-=13; } - + if(bTwoPlayerSplitscreen) { y+=iHeightOffset; @@ -784,7 +784,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glPushMatrix(); if (Minecraft::warezTime > 0) glTranslatef(0, 32, 0); font->drawShadow(ClientConstants::VERSION_STRING + L" (" + minecraft->fpsString + L")", iSafezoneXHalf+2, 20, 0xffffff); - font->drawShadow(L"Seed: " + _toString<__int64>(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); + font->drawShadow(L"Seed: " + _toString(minecraft->level->getLevelData()->getSeed() ), iSafezoneXHalf+2, 32 + 00, 0xffffff); font->drawShadow(minecraft->gatherStats1(), iSafezoneXHalf+2, 32 + 10, 0xffffff); font->drawShadow(minecraft->gatherStats2(), iSafezoneXHalf+2, 32 + 20, 0xffffff); font->drawShadow(minecraft->gatherStats3(), iSafezoneXHalf+2, 32 + 30, 0xffffff); @@ -866,7 +866,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) float t = overlayMessageTime - a; int alpha = (int) (t * 256 / 20); if (alpha > 255) alpha = 255; - if (alpha > 0) + if (alpha > 0) { glPushMatrix(); @@ -893,7 +893,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) } } #endif - + unsigned int max = 10; bool isChatting = false; if (dynamic_cast(minecraft->screen) != NULL) @@ -1026,35 +1026,35 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) // void Gui::renderBossHealth(void) // { // if (EnderDragonRenderer::bossInstance == NULL) return; -// +// // shared_ptr boss = EnderDragonRenderer::bossInstance; // EnderDragonRenderer::bossInstance = NULL; -// +// // Minecraft *pMinecraft=Minecraft::GetInstance(); -// +// // Font *font = pMinecraft->font; -// +// // ScreenSizeCalculator ssc(pMinecraft->options, pMinecraft->width_phys, pMinecraft->height_phys); // int screenWidth = ssc.getWidth(); -// +// // int w = 182; // int xLeft = screenWidth / 2 - w / 2; -// +// // int progress = (int) (boss->getSynchedHealth() / (float) boss->getMaxHealth() * (float) (w + 1)); -// +// // int yo = 12; // blit(xLeft, yo, 0, 74, w, 5); // blit(xLeft, yo, 0, 74, w, 5); -// if (progress > 0) +// if (progress > 0) // { // blit(xLeft, yo, 0, 79, progress, 5); // } -// +// // wstring msg = L"Boss health - NON LOCALISED"; // font->drawShadow(msg, screenWidth / 2 - font->width(msg) / 2, yo - 10, 0xff00ff); // glColor4f(1, 1, 1, 1); // glBindTexture(GL_TEXTURE_2D, pMinecraft->textures->loadTexture(TN_GUI_ICONS) );//"/gui/icons.png")); -// +// // } void Gui::renderPumpkin(int w, int h) @@ -1081,7 +1081,7 @@ void Gui::renderPumpkin(int w, int h) glColor4f(1, 1, 1, 1); } - + void Gui::renderVignette(float br, int w, int h) { br = 1 - br; @@ -1126,7 +1126,7 @@ void Gui::renderTp(float br, int w, int h) MemSect(31); minecraft->textures->bindTexture(TN_TERRAIN);//L"/terrain.png")); MemSect(0); - + Icon *slot = Tile::portalTile->getTexture(Facing::UP); float u0 = slot->getU0(); float v0 = slot->getV0(); @@ -1178,7 +1178,7 @@ void Gui::tick() tickCount++; for(int iPad=0;iPadheight; // This causes us to cover xScale*dataLength pixels in the horizontal @@ -1430,12 +1430,12 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff000000 + cc * 256); } - __int64 aVal = dataA[i] / dataAScale; + int64_t aVal = dataA[i] / dataAScale; t->vertex((float)(xScale*i + 0.5f), (float)( height - aVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + 0.5f), (float)( height + 0.5f), (float)( 0)); } - + if( dataB != NULL ) { if (dataB[i]>dataBWarning) @@ -1447,7 +1447,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc t->color(0xff808080 + cc/2 * 256); } - __int64 bVal = dataB[i] / dataBScale; + int64_t bVal = dataB[i] / dataBScale; t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height - bVal + 0.5f), (float)( 0)); t->vertex((float)(xScale*i + (xScale - 1) + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -1458,7 +1458,7 @@ void Gui::renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataASc glEnable(GL_TEXTURE_2D); } -void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ) +void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ) { int height = minecraft->height; @@ -1475,8 +1475,8 @@ void Gui::renderStackedGraph(int dataPos, int dataLength, int dataSources, __int Tesselator *t = Tesselator::getInstance(); t->begin(GL_LINES); - __int64 thisVal = 0; - __int64 topVal = 0; + int64_t thisVal = 0; + int64_t topVal = 0; for (int i = 0; i < dataLength; i++) { thisVal = 0; diff --git a/Minecraft.Client/Gui.h b/Minecraft.Client/Gui.h index 41762016..269e51a9 100644 --- a/Minecraft.Client/Gui.h +++ b/Minecraft.Client/Gui.h @@ -63,6 +63,6 @@ public: float getJukeboxOpacity(int iPad); // 4J Added - void renderGraph(int dataLength, int dataPos, __int64 *dataA, float dataAScale, int dataAWarning, __int64 *dataB, float dataBScale, int dataBWarning); - void renderStackedGraph(int dataPos, int dataLength, int dataSources, __int64 (*func)(unsigned int dataPos, unsigned int dataSource) ); + void renderGraph(int dataLength, int dataPos, int64_t *dataA, float dataAScale, int dataAWarning, int64_t *dataB, float dataBScale, int dataBWarning); + void renderStackedGraph(int dataPos, int dataLength, int dataSources, int64_t (*func)(unsigned int dataPos, unsigned int dataSource) ); }; diff --git a/Minecraft.Client/LevelRenderer.cpp b/Minecraft.Client/LevelRenderer.cpp index 98360078..917fa9f3 100644 --- a/Minecraft.Client/LevelRenderer.cpp +++ b/Minecraft.Client/LevelRenderer.cpp @@ -454,7 +454,7 @@ void LevelRenderer::allChanged(int playerIndex) zMaxChunk = zChunks; // 4J removed - we now only fully clear this on exiting the game (setting level to NULL). Apart from that, the chunk rebuilding is responsible for maintaining this - // renderableTileEntities.clear(); + // renderableTileEntities.clear(); for (int x = 0; x < xChunks; x++) { @@ -565,7 +565,7 @@ void LevelRenderer::renderEntities(Vec3 *cam, Culler *culler, float a) for( AUTO_VAR(it2, it->second.begin()); it2 != it->second.end(); it2++) { - TileEntityRenderDispatcher::instance->render(*it2, a); + TileEntityRenderDispatcher::instance->render(*it2, a); } } @@ -895,7 +895,7 @@ int LevelRenderer::renderChunks(int from, int to, int layer, double alpha) } -void LevelRenderer::renderSameAsLast(int layer, double alpha) +void LevelRenderer::renderSameAsLast(int layer, double alpha) { for (int i = 0; i < RENDERLISTS_LENGTH; i++) { @@ -1127,7 +1127,7 @@ void LevelRenderer::renderSky(float alpha) glPopMatrix(); // 4J - can't work out what this big black box is for. Taking it out until someone misses it... it causes a big black box to visible appear in 3rd person mode whilst under the ground. -#if 0 +#if 0 float ss = 1; float yo = -(float) (yy + 65); float y0 = -ss; @@ -1200,7 +1200,7 @@ void LevelRenderer::renderHaloRing(float alpha) // Rough lumninance calculation float Y = (sr+sr+sb+sg+sg+sg)/6; - float br = 0.6f + (Y*0.4f); + float br = 0.6f + (Y*0.4f); //app.DebugPrintf("Luminance = %f, brightness = %f\n", Y, br); glColor3f(br,br,br); @@ -1369,7 +1369,7 @@ void LevelRenderer::createCloudMesh() t->vertexUV(x0, y0, z0, u, v ); t->vertexUV(x1, y0, z0, u, v ); t->vertexUV(x1, y0, z1, u, v ); - t->vertexUV(x0, y0, z1, u, v ); + t->vertexUV(x0, y0, z1, u, v ); } } t->end(); @@ -1469,7 +1469,7 @@ void LevelRenderer::createCloudMesh() t->vertexUV(x0, y1, z0, u, v ); t->vertexUV(x1, y1, z0, u, v ); t->vertexUV(x1, y0, z0, u, v ); - t->vertexUV(x0, y0, z0, u, v ); + t->vertexUV(x0, y0, z0, u, v ); } } t->end(); @@ -1491,10 +1491,10 @@ void LevelRenderer::createCloudMesh() float z1 = z0 + 1.0f; t->color(0.8f, 0.8f, 0.8f, 0.8f); t->normal(1, 0, 0); - t->vertexUV(x0, y0, z1, u, v ); + t->vertexUV(x0, y0, z1, u, v ); t->vertexUV(x1, y0, z1, u, v ); t->vertexUV(x1, y1, z1, u, v ); - t->vertexUV(x0, y1, z1, u, v ); + t->vertexUV(x0, y1, z1, u, v ); } } t->end(); @@ -1773,7 +1773,7 @@ void LevelRenderer::renderAdvancedClouds(float alpha) t->end(); #endif } - } + } } glColor4f(1, 1, 1, 1.0f); @@ -1910,14 +1910,14 @@ bool LevelRenderer::updateDirtyChunks() { // It's possible that the localplayers member can be set to NULL on the main thread when a player chooses to exit the game // So take a reference to the player object now. As it is a shared_ptr it should live as long as we need it - shared_ptr player = mc->localplayers[p]; + shared_ptr player = mc->localplayers[p]; if( player == NULL ) continue; if( chunks[p].data == NULL ) continue; if( level[p] == NULL ) continue; if( chunks[p].length != xChunks * zChunks * CHUNK_Y_COUNT ) continue; int px = (int)player->x; int py = (int)player->y; - int pz = (int)player->z; + int pz = (int)player->z; // app.DebugPrintf("!! %d %d %d, %d %d %d {%d,%d} ",px,py,pz,stackChunkDirty,nonStackChunkDirty,onlyRebuild, xChunks, zChunks); @@ -1932,7 +1932,7 @@ bool LevelRenderer::updateDirtyChunks() ClipChunk *pClipChunk = &chunks[p][(z * yChunks + y) * xChunks + x]; // Get distance to this chunk - deliberately not calling the chunk's method of doing this to avoid overheads (passing entitie, type conversion etc.) that this involves int xd = pClipChunk->xm - px; - int yd = pClipChunk->ym - py; + int yd = pClipChunk->ym - py; int zd = pClipChunk->zm - pz; int distSq = xd * xd + yd * yd + zd * zd; int distSqWeighted = xd * xd + yd * yd * 4 + zd * zd; // Weighting against y to prioritise things in same x/z plane as player first @@ -1974,7 +1974,7 @@ bool LevelRenderer::updateDirtyChunks() // emptiness without actually testing as many data items as uncompressed data would. Chunk *chunk = pClipChunk->chunk; LevelChunk *lc = level[p]->getChunkAt(chunk->x,chunk->z); - if( !lc->isRenderChunkEmpty(y * 16) ) + if( !lc->isRenderChunkEmpty(y * 16) ) { nearChunk = pClipChunk; minDistSq = distSqWeighted; @@ -2014,7 +2014,7 @@ bool LevelRenderer::updateDirtyChunks() PIXEndNamedEvent(); } - + Chunk *chunk = NULL; #ifdef _LARGE_WORLDS @@ -2058,21 +2058,21 @@ bool LevelRenderer::updateDirtyChunks() if((veryNearCount > 0)) bAtomic = true; //MGH - if veryNearCount, then we're trying to rebuild atomically, so do it all on the main thread - if( bAtomic || (index == 0) ) + if( bAtomic || (index == 0) ) { //PIXBeginNamedEvent(0,"Rebuilding near chunk %d %d %d",chunk->x, chunk->y, chunk->z); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); //app.DebugPrintf("Rebuilding permaChunk %d\n", index); - permaChunk[index].rebuild(); + permaChunk[index].rebuild(); - if(index !=0) + if(index !=0) s_rebuildCompleteEvents->Set(index-1); // MGH - this rebuild happening on the main thread instead, mark the thread it should have been running on as complete - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); @@ -2111,11 +2111,11 @@ bool LevelRenderer::updateDirtyChunks() static Chunk permaChunk; permaChunk.makeCopyForRebuild(chunk); LeaveCriticalSection(&m_csDirtyChunks); - // static __int64 totalTime = 0; - // static __int64 countTime = 0; - // __int64 startTime = System::currentTimeMillis(); + // static int64_t totalTime = 0; + // static int64_t countTime = 0; + // int64_t startTime = System::currentTimeMillis(); permaChunk.rebuild(); - // __int64 endTime = System::currentTimeMillis(); + // int64_t endTime = System::currentTimeMillis(); // totalTime += (endTime - startTime); // countTime++; // printf("%d : %f\n", countTime, (float)totalTime / (float)countTime); @@ -2315,7 +2315,7 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev { // 4J - level is passed if this is coming from setTilesDirty, which could come from when connection is being ticked outside of normal level tick, and player won't // be set up - if( level == NULL ) level = this->level[mc->player->GetXboxPad()]; + if( level == NULL ) level = this->level[mc->player->GetXboxPad()]; // EnterCriticalSection(&m_csDirtyChunks); int _x0 = Mth::intFloorDiv(x0, CHUNK_XZSIZE); int _y0 = Mth::intFloorDiv(y0, CHUNK_SIZE); @@ -2346,10 +2346,10 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev // AP - by the time we reach this function the area passed in has a 1 block border added to it to make sure geometry and lighting is updated correctly. // Some of those blocks will only need lighting updated so it is acceptable to not have those blocks grouped in the deferral system as the mismatch - // will hardly be noticable. The blocks that need geometry updated will be adjacent to the original, non-bordered area. + // will hardly be noticable. The blocks that need geometry updated will be adjacent to the original, non-bordered area. // This bit of code will mark a chunk as 'non-critical' if all of the blocks inside it are NOT adjacent to the original area. This has the greatest effect // when digging a single block. Only 6 of the blocks out of the possible 26 are actually adjacent to the original block. The other 20 only need lighting updated. - // Note I have noticed a new side effect of this system where it's possible to see into the sides of water but this is acceptable compared to seeing through + // Note I have noticed a new side effect of this system where it's possible to see into the sides of water but this is acceptable compared to seeing through // the entire landscape. // is the left or right most block just inside this chunk if( ((x0 & 15) == 15 && x == _x0) || ((x1 & 15) == 0 && x == _x1) ) @@ -2376,7 +2376,7 @@ void LevelRenderer::setDirty(int x0, int y0, int z0, int x1, int y1, int z1, Lev dirtyChunksLockFreeStack.Push((int *)(index)); #else - dirtyChunksLockFreeStack.Push((int *)(index + 2)); + dirtyChunksLockFreeStack.Push((int *)(index + 2)); #endif #ifdef _XBOX @@ -2489,7 +2489,7 @@ void LevelRenderer::cull_SPU(int playerIndex, Culler *culler, float a) m_jobPort_CullSPU->submitSync(); // static int doSort = false; // if(doSort) - { + { m_jobPort_CullSPU->submitJob(&sortJob); } // doSort ^= 1; @@ -2591,7 +2591,7 @@ void LevelRenderer::playSound(shared_ptr entity,int iSound, double x, do } // 4J-PB - original function. I've changed to an enum instead of string compares -// 4J removed - +// 4J removed - /* void LevelRenderer::addParticle(const wstring& name, double x, double y, double z, double xa, double ya, double za) { @@ -2751,7 +2751,7 @@ shared_ptr LevelRenderer::addParticleInternal(ePARTICLE_TYPE eParticle float fStart=((float)(cStart&0xFF)); float fDiff=(float)((cEnd-cStart)&0xFF); - float fCol = (fStart + (Math::random() * fDiff))/255.0f; + float fCol = (fStart + (Math::random() * fDiff))/255.0f; particle->setColor( fCol, fCol, fCol ); } } @@ -2885,11 +2885,11 @@ void LevelRenderer::entityAdded(shared_ptr entity) //if (entity->customTextureUrl2 != L"") textures->addHttpTexture(entity->customTextureUrl2, new MobSkinTextureProcessor()); // 4J-PB - adding these from global title storage - if (entity->customTextureUrl != L"") + if (entity->customTextureUrl != L"") { textures->addMemTexture(entity->customTextureUrl, new MobSkinMemTextureProcessor()); } - if (entity->customTextureUrl2 != L"") + if (entity->customTextureUrl2 != L"") { textures->addMemTexture(entity->customTextureUrl2, new MobSkinMemTextureProcessor()); } @@ -2905,11 +2905,11 @@ void LevelRenderer::entityRemoved(shared_ptr entity) if (entity->customTextureUrl != L"") textures->removeHttpTexture(entity->customTextureUrl); if (entity->customTextureUrl2 != L"") textures->removeHttpTexture(entity->customTextureUrl2); */ - if (entity->customTextureUrl != L"") + if (entity->customTextureUrl != L"") { textures->removeMemTexture(entity->customTextureUrl); } - if (entity->customTextureUrl2 != L"") + if (entity->customTextureUrl2 != L"") { textures->removeMemTexture(entity->customTextureUrl2); } @@ -2944,7 +2944,7 @@ void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y { //case LevelEvent::SOUND_WITHER_BOSS_SPAWN: case LevelEvent::SOUND_DRAGON_DEATH: - if (mc->cameraTargetPlayer != NULL) + if (mc->cameraTargetPlayer != NULL) { // play the sound at an offset from the player double dx = x - mc->cameraTargetPlayer->x; @@ -2956,7 +2956,7 @@ void LevelRenderer::levelEvent(shared_ptr source, int type, int x, int y double sy = mc->cameraTargetPlayer->y; double sz = mc->cameraTargetPlayer->z; - if (len > 0) + if (len > 0) { sx += (dx / len) * 2; sy += (dy / len) * 2; @@ -3185,7 +3185,7 @@ void LevelRenderer::destroyTileProgress(int id, int x, int y, int z, int progres if (progress < 0 || progress >= 10) { AUTO_VAR(it, destroyingBlocks.find(id)); - if(it != destroyingBlocks.end()) + if(it != destroyingBlocks.end()) { delete it->second; destroyingBlocks.erase(it); @@ -3373,7 +3373,7 @@ unsigned char LevelRenderer::incGlobalChunkRefCount(int x, int y, int z, Level * unsigned char refCount = (flags >> CHUNK_FLAG_REF_SHIFT ) & CHUNK_FLAG_REF_MASK; refCount++; flags &= ~(CHUNK_FLAG_REF_MASK<boxes[j]->intersects( box ) ) { - boxes->push_back(AABB::newTemp( m_destroyedTiles[i]->boxes[j]->x0, + boxes->push_back(AABB::newTemp( m_destroyedTiles[i]->boxes[j]->x0, m_destroyedTiles[i]->boxes[j]->y0, m_destroyedTiles[i]->boxes[j]->z0, m_destroyedTiles[i]->boxes[j]->x1, diff --git a/Minecraft.Client/LevelRenderer.h b/Minecraft.Client/LevelRenderer.h index c0a98bba..b2bd5eb2 100644 --- a/Minecraft.Client/LevelRenderer.h +++ b/Minecraft.Client/LevelRenderer.h @@ -26,7 +26,7 @@ using namespace std; // AP - this is a system that works out which chunks actually need to be grouped together via the deferral system when doing chunk::rebuild. Doing this will reduce the number // of chunks built in a single group and reduce the chance of seeing through the landscape when digging near the edges/corners of a chunk. -// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have +// I've added another chunk flag to mark a chunk critical so it swipes a bit from the reference count value (goes to 3 bits to 2). This works on Vita because it doesn't have // split screen reference counting. #ifdef __PSVITA__ #define _CRITICAL_CHUNKS @@ -203,7 +203,7 @@ public: // 4J - added for new render list handling // This defines the maximum size of renderable level, must be big enough to cope with actual size of level + view distance at each side // so that we can render the "infinite" sea at the edges - static const int MAX_LEVEL_RENDER_SIZE[3]; + static const int MAX_LEVEL_RENDER_SIZE[3]; static const int DIMENSION_OFFSETS[3]; // This is the TOTAL area of columns of chunks to be allocated for render round the players. So for one player, it would be a region of // sqrt(PLAYER_RENDER_AREA) x sqrt(PLAYER_RENDER_AREA) @@ -258,7 +258,7 @@ public: XLockFreeStack dirtyChunksLockFreeStack; bool dirtyChunkPresent; - __int64 lastDirtyChunkFound; + int64_t lastDirtyChunkFound; static const int FORCE_DIRTY_CHUNK_CHECK_PERIOD_MS = 250; #ifdef _LARGE_WORLDS diff --git a/Minecraft.Client/LocalPlayer.h b/Minecraft.Client/LocalPlayer.h index b1e8dd23..865af154 100644 --- a/Minecraft.Client/LocalPlayer.h +++ b/Minecraft.Client/LocalPlayer.h @@ -48,14 +48,14 @@ public: void move(double xa, double ya, double za, bool noEntityCubes=false); // 4J - added noEntityCubes parameter - + int m_iScreenSection; // assuming 4player splitscreen for now, or -1 for single player - __uint64 ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft + uint64_t ullButtonsPressed; // Stores the button presses, since the inputmanager can be ticked faster than the minecraft // player tick, and a button press and release combo can be missed in the minecraft::tick - __uint64 ullDpad_last; - __uint64 ullDpad_this; - __uint64 ullDpad_filtered; + uint64_t ullDpad_last; + uint64_t ullDpad_this; + uint64_t ullDpad_filtered; // 4J-PB - moved these in from the minecraft structure, since they are per player things for splitscreen //int ticks; @@ -68,7 +68,7 @@ public: private: float flyX, flyY, flyZ; - + protected: // 4J-PB - player's xbox pad int m_iPad; diff --git a/Minecraft.Client/MinecartRenderer.cpp b/Minecraft.Client/MinecartRenderer.cpp index 0cae8346..1fa4a1d9 100644 --- a/Minecraft.Client/MinecartRenderer.cpp +++ b/Minecraft.Client/MinecartRenderer.cpp @@ -16,8 +16,8 @@ void MinecartRenderer::render(shared_ptr _cart, double x, double y, doub shared_ptr cart = dynamic_pointer_cast(_cart); glPushMatrix(); - - __int64 seed = cart->entityId * 493286711l; + + int64_t seed = cart->entityId * 493286711l; seed = seed * seed * 4392167121l + seed * 98761; float xo = ((((seed >> 16) & 0x7) + 0.5f) / 8.0f - 0.5f) * 0.004f; diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 3192410d..aef61677 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -77,15 +77,15 @@ //#define DEBUG_RENDER_SHOWS_PACKETS 1 //#define SPLITSCREEN_TEST -// If not disabled, this creates an event queue on a seperate thread so that the Level::tick calls can be offloaded +// If not disabled, this creates an event queue on a seperate thread so that the Level::tick calls can be offloaded // from the main thread, and have longer to run, since it's called at 20Hz instead of 60 #define DISABLE_LEVELTICK_THREAD Minecraft *Minecraft::m_instance = NULL; -__int64 Minecraft::frameTimes[512]; -__int64 Minecraft::tickTimes[512]; +int64_t Minecraft::frameTimes[512]; +int64_t Minecraft::tickTimes[512]; int Minecraft::frameTimePos = 0; -__int64 Minecraft::warezTime = 0; +int64_t Minecraft::warezTime = 0; File Minecraft::workDir = File(L""); #ifdef __PSVITA__ @@ -94,7 +94,7 @@ TOUCHSCREENRECT QuickSelectRect[3]= { { 560, 890, 1360, 980 }, { 450, 840, 1449, 960 }, - { 320, 840, 1600, 970 }, + { 320, 840, 1600, 970 }, }; int QuickSelectBoxWidth[3]= @@ -680,7 +680,7 @@ void Minecraft::run() return; } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); int frames = 0; while (running) @@ -705,7 +705,7 @@ void Minecraft::run() timer->advanceTime(); } - __int64 beforeTickTime = System::nanoTime(); + int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { ticks++; @@ -717,7 +717,7 @@ void Minecraft::run() // setScreen(new LevelConflictScreen()); // } } - __int64 tickDuraction = System::nanoTime() - beforeTickTime; + int64_t tickDuraction = System::nanoTime() - beforeTickTime; checkGlError(L"Pre render"); TileRenderer::fancy = options->fancyGraphics; @@ -1272,7 +1272,7 @@ void Minecraft::applyFrameMouseLook() void Minecraft::run_middle() { - static __int64 lastTime = 0; + static int64_t lastTime = 0; static bool bFirstTimeIntoGame = true; static bool bAutosaveTimerSet=false; static unsigned int uiAutosaveTimer=0; @@ -1332,7 +1332,7 @@ void Minecraft::run_middle() if( pDLCPack ) { if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { bTrialTexturepack=true; } } @@ -1454,7 +1454,7 @@ void Minecraft::run_middle() { delete m_pPsPlusUpsell; m_pPsPlusUpsell = NULL; - + if ( ProfileManager.HasPlayStationPlus(i) ) { app.DebugPrintf(" Player_%i is now authorised for PsPlus.\n", i); @@ -1796,7 +1796,7 @@ void Minecraft::run_middle() timer->advanceTime(); } - //__int64 beforeTickTime = System::nanoTime(); + //int64_t beforeTickTime = System::nanoTime(); for (int i = 0; i < timer->ticks; i++) { bool bLastTimerTick = ( i == ( timer->ticks - 1 ) ); @@ -1882,7 +1882,7 @@ void Minecraft::run_middle() // CompressedTileStorage::tick(); // 4J added // SparseDataStorage::tick(); // 4J added } - //__int64 tickDuraction = System::nanoTime() - beforeTickTime; + //int64_t tickDuraction = System::nanoTime() - beforeTickTime; MemSect(31); checkGlError(L"Pre render"); MemSect(0); @@ -2084,14 +2084,14 @@ void Minecraft::emergencySave() setLevel(NULL); } -void Minecraft::renderFpsMeter(__int64 tickTime) +void Minecraft::renderFpsMeter(int64_t tickTime) { int nsPer60Fps = 1000000000l / 60; if (lastTimer == -1) { lastTimer = System::nanoTime(); } - __int64 now = System::nanoTime(); + int64_t now = System::nanoTime(); Minecraft::tickTimes[(Minecraft::frameTimePos) & (Minecraft::frameTimes_length - 1)] = tickTime; Minecraft::frameTimes[(Minecraft::frameTimePos++) & (Minecraft::frameTimes_length - 1)] = now - lastTimer; lastTimer = now; @@ -2123,7 +2123,7 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->vertex((float)(Minecraft::frameTimes_length), (float)( height - hh1 * 2), (float)( 0)); t->end(); - __int64 totalTime = 0; + int64_t totalTime = 0; for (int i = 0; i < Minecraft::frameTimes_length; i++) { totalTime += Minecraft::frameTimes[i]; @@ -2153,8 +2153,8 @@ void Minecraft::renderFpsMeter(__int64 tickTime) t->color(0xff000000 + cc * 256); } - __int64 time = Minecraft::frameTimes[i] / 200000; - __int64 time2 = Minecraft::tickTimes[i] / 200000; + int64_t time = Minecraft::frameTimes[i] / 200000; + int64_t time2 = Minecraft::tickTimes[i] / 200000; t->vertex((float)(i + 0.5f), (float)( height - time + 0.5f), (float)( 0)); t->vertex((float)(i + 0.5f), (float)( height + 0.5f), (float)( 0)); @@ -2234,7 +2234,7 @@ void Minecraft::levelTickThreadInitFunc() { AABB::CreateNewThreadStorage(); Vec3::CreateNewThreadStorage(); - IntCache::CreateNewThreadStorage(); + IntCache::CreateNewThreadStorage(); Compression::UseDefaultThreadStorage(); } @@ -2863,7 +2863,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) *piUse=IDS_TOOLTIPS_MILK; break; case Item::shears_Id: - { + { if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; shared_ptr animal = dynamic_pointer_cast(hitResult->entity); if(!animal->isBaby()) *piUse=IDS_TOOLTIPS_SHEAR; @@ -3136,7 +3136,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } if(player->isAllowedToAttackAnimals()) *piAction=IDS_TOOLTIPS_HIT; - + if(ocelot->isTame()) { // 4J-PB - if you have a raw fish in your hand, you will feed the ocelot rather than have it sit/follow @@ -3153,7 +3153,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } else { - *piUse=IDS_TOOLTIPS_FEED; + *piUse=IDS_TOOLTIPS_FEED; } } @@ -3182,9 +3182,9 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } } } - + break; - + case eTYPE_PLAYER: { // Fix for #58576 - TU6: Content: Gameplay: Hit button prompt is available when attacking a host who has "Invisible" option turned on @@ -3230,7 +3230,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } *piAction=IDS_TOOLTIPS_HIT; } - break; + break; case eTYPE_ZOMBIE: { shared_ptr zomb = dynamic_pointer_cast(hitResult->entity); @@ -3483,7 +3483,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) player->abilities.debugflying = !player->abilities.debugflying; player->abilities.flying = !player->abilities.flying; } -#endif // PSVITA +#endif // PSVITA } #endif @@ -3551,8 +3551,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) player->drop(); } - __uint64 ullButtonsPressed=player->ullButtonsPressed; - + uint64_t ullButtonsPressed=player->ullButtonsPressed; + bool selected = false; #ifdef __PSVITA__ // 4J-PB - use the touchscreen for quickselect @@ -3576,7 +3576,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) shared_ptr selectedItem = player->getSelectedItem(); // Dropping items happens over network, so if we only have one then assume that we dropped it and should hide the item int iCount=0; - + if(selectedItem != NULL) iCount=selectedItem->GetCount(); if(selectedItem != NULL && !( (player->ullButtonsPressed&(1LL<GetCount() == 1)) { @@ -3885,7 +3885,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } #ifdef __PS3__ -// while(!g_tickLevelQueue.empty()) +// while(!g_tickLevelQueue.empty()) // { // Level* pLevel = g_tickLevelQueue.front(); // g_tickLevelQueue.pop(); @@ -4113,7 +4113,7 @@ void Minecraft::setLevel(MultiPlayerLevel *level, int message /*=-1*/, shared_pt player->resetPos(); gameMode->initPlayer(player); - + player->SetXboxPad(iPrimaryPlayer); for(int i=0;i(System::currentTimeMillis() % 1000); + name = L"Player" + _toString(System::currentTimeMillis() % 1000); sessionId = L"-"; /* 4J - TODO - get a session ID from somewhere? if (args.length > 0) name = args[0]; @@ -4647,7 +4647,7 @@ void Minecraft::delayTextureReload() reloadTextures = true; } -__int64 Minecraft::currentTimeMillis() +int64_t Minecraft::currentTimeMillis() { return System::currentTimeMillis();//(Sys.getTime() * 1000) / Sys.getTimerResolution(); } @@ -5018,8 +5018,8 @@ int Minecraft::MustSignInReturnedPSN(void *pParam, int iPad, C4JStorage::EMessag { Minecraft* pMinecraft = (Minecraft *)pParam; - if(result == C4JStorage::EMessage_ResultAccept) - { + if(result == C4JStorage::EMessage_ResultAccept) + { SQRNetworkManager_Orbis::AttemptPSNSignIn(&Minecraft::InGame_SignInReturned, pMinecraft, false, iPad); } diff --git a/Minecraft.Client/Minecraft.h b/Minecraft.Client/Minecraft.h index caec4702..2e943de7 100644 --- a/Minecraft.Client/Minecraft.h +++ b/Minecraft.Client/Minecraft.h @@ -71,7 +71,7 @@ private: bool hasCrashed; C4JThread::EventQueue* levelTickEventQueue; - + static void levelTickUpdateFunc(void* pParam); static void levelTickThreadInitFunc(); @@ -165,11 +165,11 @@ private: LevelStorageSource *levelSource; public: static const int frameTimes_length = 512; - static __int64 frameTimes[frameTimes_length]; + static int64_t frameTimes[frameTimes_length]; static const int tickTimes_length = 512; - static __int64 tickTimes[tickTimes_length]; + static int64_t tickTimes[tickTimes_length]; static int frameTimePos; - static __int64 warezTime; + static int64_t warezTime; private: int rightClickDelay; public: @@ -230,9 +230,9 @@ private: // String grabHugeScreenshot(File workDir2, int width, int height, int ssWidth, int ssHeight); // 4J - removed // 4J - per player thing? - __int64 lastTimer; + int64_t lastTimer; - void renderFpsMeter(__int64 tickTime); + void renderFpsMeter(int64_t tickTime); public: void stop(); // 4J removed @@ -253,7 +253,7 @@ public: //bool isRaining ; // 4J - Moved to per player - //__int64 lastTickTime; + //int64_t lastTickTime; private: // 4J- per player? @@ -301,7 +301,7 @@ public: static int maxSupportedTextureSize(); void delayTextureReload(); - static __int64 currentTimeMillis(); + static int64_t currentTimeMillis(); #ifdef _DURANGO static void inGameSignInCheckAllPrivilegesCallback(LPVOID lpParam, bool hasPrivileges, int iPad); diff --git a/Minecraft.Client/MinecraftServer.cpp b/Minecraft.Client/MinecraftServer.cpp index ceb9554b..a57b798b 100644 --- a/Minecraft.Client/MinecraftServer.cpp +++ b/Minecraft.Client/MinecraftServer.cpp @@ -54,9 +54,9 @@ //4J Added MinecraftServer *MinecraftServer::server = NULL; bool MinecraftServer::setTimeAtEndOfTick = false; -__int64 MinecraftServer::setTime = 0; +int64_t MinecraftServer::setTime = 0; bool MinecraftServer::setTimeOfDayAtEndOfTick = false; -__int64 MinecraftServer::setTimeOfDay = 0; +int64_t MinecraftServer::setTimeOfDay = 0; bool MinecraftServer::m_bPrimaryPlayerSignedOut=false; bool MinecraftServer::s_bServerHalted=false; bool MinecraftServer::s_bSaveOnExitAnswered=false; @@ -99,7 +99,7 @@ MinecraftServer::~MinecraftServer() { } -bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed) +bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed) { // 4J - removed #if 0 @@ -149,7 +149,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW //localIp = settings->getString(L"server-ip", L""); //onlineMode = settings->getBoolean(L"online-mode", true); //motd = settings->getString(L"motd", L"A Minecraft Server"); - //motd.replace('§', '$'); + //motd.replace('�', '$'); setAnimals(settings->getBoolean(L"spawn-animals", true)); setNpcsEnabled(settings->getBoolean(L"spawn-npcs", true)); @@ -201,7 +201,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW // TODO: Stop loading, add error message. } - __int64 levelNanoTime = System::nanoTime(); + int64_t levelNanoTime = System::nanoTime(); wstring levelName = settings->getString(L"level-name", L"world"); wstring levelTypeString; @@ -221,7 +221,7 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW } LevelType *pLevelType = LevelType::getLevelType(levelTypeString); - if (pLevelType == NULL) + if (pLevelType == NULL) { pLevelType = LevelType::lvl_normal; } @@ -245,10 +245,10 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW #if 0 wstring levelSeedString = settings->getString(L"level-seed", L""); - __int64 levelSeed = (new Random())->nextLong(); + int64_t levelSeed = (new Random())->nextLong(); if (levelSeedString.length() > 0) { - long newSeed = _fromString<__int64>(levelSeedString); + long newSeed = _fromString(levelSeedString); if (newSeed != 0) { levelSeed = newSeed; } @@ -280,7 +280,7 @@ int MinecraftServer::runPostUpdate(void* lpParam) Entity::useSmallIds(); // This thread can end up spawning entities as resources IntCache::CreateNewThreadStorage(); AABB::CreateNewThreadStorage(); - Vec3::CreateNewThreadStorage(); + Vec3::CreateNewThreadStorage(); Compression::UseDefaultThreadStorage(); Level::enableLightingCache(); Tile::CreateNewThreadStorage(); @@ -375,7 +375,7 @@ void MinecraftServer::postProcessTerminate(ProgressRenderer *mcprogress) DeleteCriticalSection(&m_postProcessCS); } -bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) +bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData) { // 4J - TODO - do with new save stuff // if (storageSource->requiresConversion(name)) @@ -401,10 +401,10 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring { // We are loading a file from disk with the data passed in -#ifdef SPLIT_SAVES +#ifdef SPLIT_SAVES ConsoleSaveFileOriginal oldFormatSave( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform ); ConsoleSaveFile* pSave = new ConsoleSaveFileSplit( &oldFormatSave ); - + //ConsoleSaveFile* pSave = new ConsoleSaveFileSplit( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform ); #else ConsoleSaveFile* pSave = new ConsoleSaveFileOriginal( initData->saveData->saveName, initData->saveData->data, initData->saveData->fileSize, false, initData->savePlatform ); @@ -445,7 +445,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } // McRegionLevelStorage *storage = new McRegionLevelStorage(new ConsoleSaveFile( L"" ), L"", L"", 0); // original -// McRegionLevelStorage *storage = new McRegionLevelStorage(File(L"."), name, true); // TODO +// McRegionLevelStorage *storage = new McRegionLevelStorage(File(L"."), name, true); // TODO for (unsigned int i = 0; i < levels.length; i++) { if( s_bServerHalted || !g_NetworkManager.IsInSession() ) @@ -518,13 +518,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring m_postUpdateThread->SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); m_postUpdateThread->Run(); - __int64 startTime = System::currentTimeMillis(); + int64_t startTime = System::currentTimeMillis(); // 4J Stu - Added this to temporarily make starting games on vita faster #ifdef __PSVITA__ int r = 48; #else - int r = 196; + int r = 196; #endif // 4J JEV: load gameRules. @@ -548,7 +548,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring csf->closeHandle(fe); } - __int64 lastTime = System::currentTimeMillis(); + int64_t lastTime = System::currentTimeMillis(); // 4J Stu - This loop is changed in 1.0.1 to only process the first level (ie the overworld), but I think we still want to do them all int i = 0; @@ -564,7 +564,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } #if 0 - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); // Test code to enable full creation of levels at start up int halfsidelen = ( i == 0 ) ? 27 : 9; @@ -587,7 +587,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring } } #else - __int64 lastStorageTickTime = System::currentTimeMillis(); + int64_t lastStorageTickTime = System::currentTimeMillis(); Pos *spawnPos = level->getSharedSpawnPos(); int twoRPlusOne = r*2 + 1; @@ -604,7 +604,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring return false; } // printf(">>>%d %d %d\n",i,x,z); -// __int64 now = System::currentTimeMillis(); +// int64_t now = System::currentTimeMillis(); // if (now < lastTime) lastTime = now; // if (now > lastTime + 1000) { @@ -663,7 +663,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring if(!levels[0]->getLevelData()->getHasStronghold()) { - int x,z; + int x,z; if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z)) { levels[0]->getLevelData()->setXStronghold(x); @@ -691,7 +691,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring // printf("Lighting complete at %dms\n",System::currentTimeMillis() - startTime); if( s_bServerHalted || !g_NetworkManager.IsInSession() ) return false; - + if( levels[1]->isNew ) { levels[1]->save(true, mcprogress); @@ -710,7 +710,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring // 4J Stu - We also want to immediately save the tutorial if ( levels[0]->isNew ) saveGameRules(); - + if( levels[0]->isNew ) { levels[0]->save(true, mcprogress); @@ -819,7 +819,7 @@ void MinecraftServer::Suspend() // Save the start time QueryPerformanceCounter( &qwTime ); if(m_bLoaded && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled())) - { + { if (players != NULL) { players->saveAll(NULL); @@ -879,7 +879,7 @@ void MinecraftServer::stopServer() app.DebugPrintf("Stopping server\n"); // logger.info("Stopping server"); // 4J-PB - If the primary player has signed out, then don't attempt to save anything - + // also need to check for a profile switch here - primary player signs out, and another player signs in before dismissing the dash #ifdef _DURANGO // On Durango check if the primary user is signed in OR mid-sign-out @@ -894,7 +894,7 @@ void MinecraftServer::stopServer() #endif // if trial version or saving is disabled, then don't save anything if(m_saveOnExit && ProfileManager.IsFullVersion() && (!StorageManager.GetSaveDisabled())) - { + { if (players != NULL) { players->saveAll(Minecraft::GetInstance()->progressRenderer, true); @@ -1044,7 +1044,7 @@ CommandDispatcher *MinecraftServer::getCommandDispatcher() } extern int c0a, c0b, c1a, c1b, c1c, c2a, c2b; -void MinecraftServer::run(__int64 seed, void *lpParameter) +void MinecraftServer::run(int64_t seed, void *lpParameter) { NetworkGameInitData *initData = NULL; DWORD initSettings = 0; @@ -1066,7 +1066,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) if(pLevelData && pLevelData->getHasStronghold()==false) { - int x,z; + int x,z; if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z)) { pLevelData->setXStronghold(x); @@ -1075,18 +1075,18 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } } - __int64 lastTime = System::currentTimeMillis(); - __int64 unprocessedTime = 0; + int64_t lastTime = System::currentTimeMillis(); + int64_t unprocessedTime = 0; while (running && !s_bServerHalted) { - __int64 now = System::currentTimeMillis(); + int64_t now = System::currentTimeMillis(); // 4J Stu - When we pause the server, we don't want to count that as time passed // 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused //Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost //if(m_isServerPaused) lastTime = now; - __int64 passedTime = now - lastTime; + int64_t passedTime = now - lastTime; if (passedTime > MS_PER_TICK * 40) { // logger.warning("Can't keep up! Did the system time change, or is the server overloaded?"); @@ -1112,13 +1112,13 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) else { // int tickcount = 0; -// __int64 beforeall = System::currentTimeMillis(); +// int64_t beforeall = System::currentTimeMillis(); while (unprocessedTime > MS_PER_TICK) { unprocessedTime -= MS_PER_TICK; -// __int64 before = System::currentTimeMillis(); +// int64_t before = System::currentTimeMillis(); tick(); -// __int64 after = System::currentTimeMillis(); +// int64_t after = System::currentTimeMillis(); // PIXReportCounter(L"Server time",(float)(after-before)); // 4J Ensure that the slow queue owner keeps cycling if it's not been used in a while @@ -1135,7 +1135,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) // app.DebugPrintf("Not considering cycling: %d - %d -> %d > %d\n",time, s_slowQueueLastTime, (time - s_slowQueueLastTime), (2*MINECRAFT_SERVER_SLOW_QUEUE_DELAY)); // } } -// __int64 afterall = System::currentTimeMillis(); +// int64_t afterall = System::currentTimeMillis(); // PIXReportCounter(L"Server time all",(float)(afterall-beforeall)); // PIXReportCounter(L"Server ticks",(float)tickcount); } @@ -1179,7 +1179,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) } } - // Process delayed actions + // Process delayed actions eXuiServerAction eAction; LPVOID param; for(int i=0;isaveAll(Minecraft::GetInstance()->progressRenderer); } - + players->broadcastAll( shared_ptr( new UpdateProgressPacket(20) ) ); for (unsigned int j = 0; j < levels.length; j++) @@ -1255,14 +1255,14 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) // Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting. ServerLevel *level = levels[levels.length - 1 - j]; level->save(true, Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); - + players->broadcastAll( shared_ptr( new UpdateProgressPacket(33 + (j*33) ) ) ); } if( !s_bServerHalted ) { saveGameRules(); - levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); + levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame)); } app.LeaveSaveNotificationSection(); break; @@ -1287,19 +1287,19 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) case eXuiServerAction_PauseServer: m_isServerPaused = ( (size_t) param == TRUE ); if( m_isServerPaused ) - { + { m_serverPausedEvent->Set(); } break; case eXuiServerAction_ToggleRain: - { + { bool isRaining = levels[0]->getLevelData()->isRaining(); levels[0]->getLevelData()->setRaining(!isRaining); levels[0]->getLevelData()->setRainTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2); } break; case eXuiServerAction_ToggleThunder: - { + { bool isThundering = levels[0]->getLevelData()->isThundering(); levels[0]->getLevelData()->setThundering(!isThundering); levels[0]->getLevelData()->setThunderTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2); @@ -1318,7 +1318,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) case eXuiServerAction_ExportSchematic: #ifndef _CONTENT_PACKAGE app.EnterSaveNotificationSection(); - + //players->broadcastAll( shared_ptr( new UpdateProgressPacket(20) ) ); if( !s_bServerHalted ) @@ -1337,7 +1337,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) File dataFile = File( targetFileDir, wstring(filename) ); if(dataFile.exists()) dataFile._delete(); FileOutputStream fos = FileOutputStream(dataFile); - DataOutputStream dos = DataOutputStream(&fos); + DataOutputStream dos = DataOutputStream(&fos); ConsoleSchematicFile::generateSchematicFile(&dos, levels[0], initData->startX, initData->startY, initData->startZ, initData->endX, initData->endY, initData->endZ, initData->bSaveMobs, initData->compressionType); dos.close(); @@ -1354,7 +1354,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) app.DebugPrintf( "DEBUG: Player=%i\n", pos->player ); app.DebugPrintf( "DEBUG: Teleporting to pos=(%f.2, %f.2, %f.2), looking at=(%f.2,%f.2)\n", pos->m_camX, pos->m_camY, pos->m_camZ, - pos->m_yRot, pos->m_elev + pos->m_yRot, pos->m_elev ); shared_ptr player = players->players.at(pos->player); @@ -1368,7 +1368,7 @@ void MinecraftServer::run(__int64 seed, void *lpParameter) #endif break; } - + app.SetXuiServerAction(i,eXuiServerAction_Idle); } @@ -1447,7 +1447,7 @@ void MinecraftServer::tick() AABB::resetPool(); Vec3::resetPool(); - + tickCount++; // 4J We need to update client difficulty levels based on the servers @@ -1479,11 +1479,11 @@ void MinecraftServer::tick() players->broadcastAll( shared_ptr( new SetTimePacket(level->getTime() ) ), level->dimension->id); } // #ifndef __PS3__ - static __int64 stc = 0; - __int64 st0 = System::currentTimeMillis(); + static int64_t stc = 0; + int64_t st0 = System::currentTimeMillis(); PIXBeginNamedEvent(0,"Level tick %d",i); ((Level *)level)->tick(); - __int64 st1 = System::currentTimeMillis(); + int64_t st1 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Update lights %d",i); // 4J - used to be in a while loop, but we don't want the server locking up for a big chunk of time (could end up trying to process 1,000,000 lights...) @@ -1491,7 +1491,7 @@ void MinecraftServer::tick() // printf("lights: %d\n",level->getLightsToUpdate()); while(level->updateLights() ) ; - __int64 st2 = System::currentTimeMillis(); + int64_t st2 = System::currentTimeMillis(); PIXEndNamedEvent(); PIXBeginNamedEvent(0,"Entity tick %d",i); // 4J added to stop ticking entities in levels when players are not in those levels. @@ -1519,7 +1519,7 @@ void MinecraftServer::tick() level->getTracker()->tick(); PIXEndNamedEvent(); - __int64 st3 = System::currentTimeMillis(); + int64_t st3 = System::currentTimeMillis(); // printf(">>>>>>>>>>>>>>>>>>>>>> Tick %d %d %d : %d\n", st1 - st0, st2 - st1, st3 - st2, st0 - stc ); stc = st0; // #endif// __PS3__ @@ -1564,7 +1564,7 @@ void MinecraftServer::handleConsoleInputs() } } -void MinecraftServer::main(__int64 seed, void *lpParameter) +void MinecraftServer::main(int64_t seed, void *lpParameter) { #if __PS3__ ShutdownManager::HasStarted(ShutdownManager::eServerThread ); diff --git a/Minecraft.Client/MinecraftServer.h b/Minecraft.Client/MinecraftServer.h index e61001a3..f63aeb0b 100644 --- a/Minecraft.Client/MinecraftServer.h +++ b/Minecraft.Client/MinecraftServer.h @@ -23,14 +23,14 @@ class CommandDispatcher; typedef struct _LoadSaveDataThreadParam { LPVOID data; - __int64 fileSize; + int64_t fileSize; const wstring saveName; - _LoadSaveDataThreadParam(LPVOID data, __int64 filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} + _LoadSaveDataThreadParam(LPVOID data, int64_t filesize, const wstring &saveName) : data( data ), fileSize( filesize ), saveName( saveName ) {} } LoadSaveDataThreadParam; typedef struct _NetworkGameInitData { - __int64 seed; + int64_t seed; LoadSaveDataThreadParam *saveData; DWORD settings; LevelGenerationOptions *levelGen; @@ -125,9 +125,9 @@ public: ~MinecraftServer(); private: // 4J Added - LoadSaveDataThreadParam - bool initServer(__int64 seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); + bool initServer(int64_t seed, NetworkGameInitData *initData, DWORD initSettings, bool findSeed); void postProcessTerminate(ProgressRenderer *mcprogress); - bool loadLevel(LevelStorageSource *storageSource, const wstring& name, __int64 levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); + bool loadLevel(LevelStorageSource *storageSource, const wstring& name, int64_t levelSeed, LevelType *pLevelType, NetworkGameInitData *initData); void setProgress(const wstring& status, int progress); void endProgress(); void saveAllChunks(); @@ -154,7 +154,7 @@ public: public: void halt(); - void run(__int64 seed, void *lpParameter); + void run(int64_t seed, void *lpParameter); void broadcastStartSavingPacket(); void broadcastStopSavingPacket(); @@ -165,7 +165,7 @@ public: void handleConsoleInput(const wstring& msg, ConsoleInputSource *source); void handleConsoleInputs(); // void addTickable(Tickable tickable); // 4J removed - static void main(__int64 seed, void *lpParameter); + static void main(int64_t seed, void *lpParameter); static void HaltServer(bool bPrimaryPlayerSignedOut=false); File *getFile(const wstring& name); @@ -185,9 +185,9 @@ private: static MinecraftServer *server; static bool setTimeOfDayAtEndOfTick; - static __int64 setTimeOfDay; + static int64_t setTimeOfDay; static bool setTimeAtEndOfTick; - static __int64 setTime; + static int64_t setTime; static bool m_bPrimaryPlayerSignedOut; // 4J-PB added to tell the stopserver not to save the game - another player may have signed in in their place, so ProfileManager.IsSignedIn isn't enough static bool s_bServerHalted; // 4J Stu Added so that we can halt the server even before it's been created properly @@ -211,9 +211,9 @@ public: public: static PlayerList *getPlayerList() { if( server != NULL ) return server->players; else return NULL; } - static void SetTimeOfDay(__int64 time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } - static void SetTime(__int64 time) { setTimeAtEndOfTick = true; setTime = time; } - + static void SetTimeOfDay(int64_t time) { setTimeOfDayAtEndOfTick = true; setTimeOfDay = time; } + static void SetTime(int64_t time) { setTimeAtEndOfTick = true; setTime = time; } + C4JThread::Event* m_serverPausedEvent; private: // 4J Added @@ -241,5 +241,5 @@ public: void Suspend(); bool IsSuspending(); - // 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them + // 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them }; diff --git a/Minecraft.Client/Orbis/Iggy/include/rrCore.h b/Minecraft.Client/Orbis/Iggy/include/rrCore.h index e88b5f8c..e72c3466 100644 --- a/Minecraft.Client/Orbis/Iggy/include/rrCore.h +++ b/Minecraft.Client/Orbis/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed int64_t + #define RAD_UINTa __w64 uint64_t #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Orbis/Miles/include/mss.h b/Minecraft.Client/Orbis/Miles/include/mss.h index 531dcbc9..754f536b 100644 --- a/Minecraft.Client/Orbis/Miles/include/mss.h +++ b/Minecraft.Client/Orbis/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef uint64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the byte size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/Orbis/Miles/include/rrCore.h b/Minecraft.Client/Orbis/Miles/include/rrCore.h index e88b5f8c..4ba70d3a 100644 --- a/Minecraft.Client/Orbis/Miles/include/rrCore.h +++ b/Minecraft.Client/Orbis/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp index 5c02cb08..3f621046 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.cpp @@ -21,8 +21,8 @@ int (* SQRNetworkManager_Orbis::s_SignInCompleteCallbackFn)(void *pParam, bool b void * SQRNetworkManager_Orbis::s_SignInCompleteParam = NULL; sce::Toolkit::NP::PresenceDetails SQRNetworkManager_Orbis::s_lastPresenceInfo; -__int64 SQRNetworkManager_Orbis::s_lastPresenceTime = 0; -__int64 SQRNetworkManager_Orbis::s_resendPresenceTime = 0; +int64_t SQRNetworkManager_Orbis::s_lastPresenceTime = 0; +int64_t SQRNetworkManager_Orbis::s_resendPresenceTime = 0; bool SQRNetworkManager_Orbis::s_presenceStatusDirty = false; bool SQRNetworkManager_Orbis::s_presenceDataDirty = false; @@ -51,7 +51,7 @@ int g_numRUDPContextsBound = 0; //unsigned int SQRNetworkManager_Orbis::RoomSyncData::playerCount = 0; // This maps internal to extern states, and needs to match element-by-element the eSQRNetworkManagerInternalState enumerated type -const SQRNetworkManager_Orbis::eSQRNetworkManagerState SQRNetworkManager_Orbis::m_INTtoEXTStateMappings[SQRNetworkManager_Orbis::SNM_INT_STATE_COUNT] = +const SQRNetworkManager_Orbis::eSQRNetworkManagerState SQRNetworkManager_Orbis::m_INTtoEXTStateMappings[SQRNetworkManager_Orbis::SNM_INT_STATE_COUNT] = { SNM_STATE_INITIALISING, // SNM_INT_STATE_UNINITIALISED SNM_STATE_INITIALISING, // SNM_INT_STATE_SIGNING_IN @@ -143,7 +143,7 @@ void SQRNetworkManager_Orbis::Initialise() assert( m_state == SNM_INT_STATE_UNINITIALISED ); - + //Initialize libnetctl ret = sceNetCtlInit(); if( ( ret < 0 /*&& ret != CELL_NET_CTL_ERROR_NOT_TERMINATED*/ ) || ForceErrorPoint( SNM_FORCE_ERROR_NET_CTL_INIT ) ) @@ -172,14 +172,14 @@ void SQRNetworkManager_Orbis::Initialise() SonyHttp::init(); ret = sceNpSetNpTitleId(GetSceNpTitleId(), GetSceNpTitleSecret()); - if (ret < 0) + if (ret < 0) { app.DebugPrintf("sceNpSetNpTitleId failed, ret=%x\n", ret); assert(0); } ret = sceRudpEnableInternalIOThread(RUDP_THREAD_STACK_SIZE, RUDP_THREAD_PRIORITY); - if(ret < 0) + if(ret < 0) { app.DebugPrintf("sceRudpEnableInternalIOThread failed with error code 0x%08x\n", ret); assert(0); @@ -192,7 +192,7 @@ void SQRNetworkManager_Orbis::Initialise() else { // On Orbis, PSN sign in is only handled by the XMB - SetState(SNM_INT_STATE_IDLE); + SetState(SNM_INT_STATE_IDLE); } SonyVoiceChat_Orbis::init(); @@ -299,7 +299,7 @@ void SQRNetworkManager_Orbis::InitialiseAfterOnline() ret = sceNpMatching2CreateContext(¶m, &m_matchingContext); - + if( ( ret < 0 ) || ForceErrorPoint( SNM_FORCE_ERROR_CREATE_MATCHING_CONTEXT ) ) { app.DebugPrintf("SQRNetworkManager_Orbis::InitialiseAfterOnline - sceNpMatching2CreateContext failed with error 0x%08x\n", ret); @@ -398,7 +398,7 @@ void SQRNetworkManager_Orbis::Tick() { // make sure we've removed all the remote players and killed the udp connections before we bail out if(m_RudpCtxToPlayerMap.size() == 0) - ResetToIdle(); + ResetToIdle(); } EnterCriticalSection(&m_csStateChangeQueue); @@ -451,7 +451,7 @@ void SQRNetworkManager_Orbis::tickErrorDialog() if(s_errorDialogRunning) { SceErrorDialogStatus s = sceErrorDialogUpdateStatus(); - switch (s) + switch (s) { case SCE_ERROR_DIALOG_STATUS_NONE: assert(0); @@ -465,9 +465,9 @@ void SQRNetworkManager_Orbis::tickErrorDialog() case SCE_ERROR_DIALOG_STATUS_FINISHED: sceErrorDialogTerminate(); s_errorDialogRunning = false; - + // Start callback timer - s_SignInCompleteCallbackPending = true; + s_SignInCompleteCallbackPending = true; s_errorDialogClosed = System::currentTimeMillis(); break; } @@ -490,9 +490,9 @@ void SQRNetworkManager_Orbis::tickErrorDialog() SceSystemServiceStatus status = SceSystemServiceStatus(); sceSystemServiceGetStatus(&status); bool systemUiDisplayed = status.isInBackgroundExecution || status.isSystemUiOverlaid; - + if (systemUiDisplayed) - { + { // Wait till the system goes away } else @@ -583,7 +583,7 @@ void SQRNetworkManager_Orbis::ErrorHandlingTick() DeleteServerContext(); break; } - + } // Start hosting a game, by creating a room & joining it. We explicity create a server context here (via GetServerContext) as Sony suggest that @@ -643,7 +643,7 @@ void SQRNetworkManager_Orbis::UpdateExternalRoomData() { if( m_offlineGame ) return; if( m_isHosting ) - { + { SceNpMatching2SetRoomDataExternalRequest reqParam; memset( &reqParam, 0, sizeof(reqParam) ); reqParam.roomId = m_room; @@ -774,13 +774,13 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter ) do { ret = sceKernelWaitEqueue(manager->m_basicEventQueue, &event, 1, &outEv, NULL); - + // If the sys_event_t we've sent here from the handler has a non-zero data1 element, this is to signify that we should terminate the thread if( event.udata == 0 ) { // int iEvent; // SceNpUserInfo from; -// uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE]; +// uint8_t buffer[SCE_NP_BASIC_MAX_MESSAGE_SIZE]; // size_t bufferSize = SCE_NP_BASIC_MAX_MESSAGE_SIZE; // int ret = sceNpBasicGetEvent(&iEvent, &from, &buffer, &bufferSize); // if( ret == 0 ) @@ -788,7 +788,7 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter ) // if( iEvent == SCE_NP_BASIC_EVENT_INCOMING_BOOTABLE_INVITATION ) // { // // 4J Stu - Don't do this here as it can be very disruptive to gameplay. Players can bring this up from LoadOrJoinMenu, PauseMenu and InGameInfoMenu -// //sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID); +// //sceNpBasicRecvMessageCustom(SCE_NP_BASIC_MESSAGE_MAIN_TYPE_INVITE, SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE, SYS_MEMORY_CONTAINER_ID_INVALID); // } // if( iEvent == SCE_NP_BASIC_EVENT_RECV_INVITATION_RESULT ) // { @@ -835,12 +835,12 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter ) return 0; } - if (friendList.hasResult()) + if (friendList.hasResult()) { - sce::Toolkit::NP::FriendsList::const_iterator iter ; + sce::Toolkit::NP::FriendsList::const_iterator iter ; int i = 1 ; bool noFriends = true; - for (iter = friendList.get()->begin(); iter != friendList.get()->end() ; ++iter,i++) + for (iter = friendList.get()->begin(); iter != friendList.get()->end() ; ++iter,i++) { manager->m_friendCount++; noFriends = false; @@ -848,7 +848,7 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter ) app.DebugPrintf("Online Name: %s\n",iter->npid.handle.data); app.DebugPrintf("------------------------\n"); - + sce::Toolkit::NP::PresenceRequest presenceRequest; sce::Toolkit::NP::Utilities::Future presenceInfo; memset(&presenceRequest,0,sizeof(presenceRequest)); @@ -858,11 +858,11 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter ) ret = sce::Toolkit::NP::Presence::Interface::getPresence(&presenceRequest,&presenceInfo,false); - if( ret < 0 ) + if( ret < 0 ) { app.DebugPrintf("getPresence() error. ret = 0x%x\n", ret); } - else + else { app.DebugPrintf("\nPresence Data Retrieved:\n"); app.DebugPrintf("Platform Type: %s\n", presenceInfo.get()->platformType.c_str()); @@ -897,13 +897,13 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter ) } } } - else if (friendList.hasError()) + else if (friendList.hasError()) { app.DebugPrintf( "Error occurred while retrieving FriendsList, ret = 0x%x\n", friendList.getError()); app.DebugPrintf("Check sign-in status\n"); } - + return 0; } @@ -944,7 +944,7 @@ bool SQRNetworkManager_Orbis::IsReadyToPlayOrIdle() // Consider as "in session" from the moment that a game is created or joined, until the point where the game itself has been told via state change that we are now idle. The -// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and +// game code requires IsInSession to return true as soon as it has asked to do one of these things (even if the state system hasn't really caught up with this request yet), and // it also requires that it is informed of the state changes leading up to not being in the session, before this should report false. bool SQRNetworkManager_Orbis::IsInSession() { @@ -1119,7 +1119,7 @@ bool SQRNetworkManager_Orbis::JoinRoom(SceNpMatching2RoomId roomId, SceNpMatchin m_localPlayerJoinMask = localPlayerMask; m_localPlayerCount = 0; m_localPlayerJoined = 0; - + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) { if( localPlayerMask & ( 1 << i ) ) m_localPlayerCount++; @@ -1240,7 +1240,7 @@ bool SQRNetworkManager_Orbis::AddLocalPlayerByUserIndex(int idx) // Sync this back out to our networked clients... SyncRoomData(); - + UpdateRemotePlay(); // no connections being made because we're all on the host, so add this player to the existing connections @@ -1264,7 +1264,7 @@ bool SQRNetworkManager_Orbis::AddLocalPlayerByUserIndex(int idx) memset(&reqParam, 0, sizeof(reqParam)); memset(&binAttr, 0, sizeof(binAttr)); - + binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID; binAttr.ptr = &m_localPlayerJoinMask; binAttr.size = sizeof(m_localPlayerJoinMask); @@ -1357,7 +1357,7 @@ bool SQRNetworkManager_Orbis::RemoveLocalPlayerByUserIndex(int idx) memset(&reqParam, 0, sizeof(reqParam)); memset(&binAttr, 0, sizeof(binAttr)); - + binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID; binAttr.ptr = &m_localPlayerJoinMask; binAttr.size = sizeof(m_localPlayerJoinMask); @@ -1395,7 +1395,7 @@ void SQRNetworkManager_Orbis::UpdateRemotePlay() extern uint8_t *mallocAndCreateUTF8ArrayFromString(int iID); -// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that +// Bring up a Gui to send an invite so a player that the user can select. This invite will contain the room Id so that void SQRNetworkManager_Orbis::SendInviteGUI() { if(s_bInviteDialogRunning) @@ -1403,7 +1403,7 @@ void SQRNetworkManager_Orbis::SendInviteGUI() app.DebugPrintf("SendInviteGUI - Invite dialog is already running so ignoring request\n"); return; } - + s_bInviteDialogRunning = true; //Set invitation information - this is now exactly the same as the presence information that we synchronise out. @@ -1428,7 +1428,7 @@ void SQRNetworkManager_Orbis::SendInviteGUI() messData.dialogFlag = SCE_TOOLKIT_NP_DIALOG_TYPE_USER_EDITABLE; messData.npIdsCount = 2; // TODO: Set this to the number of available slots messData.npIds = NULL; - messData.userInfo.userId = userId; + messData.userInfo.userId = userId; // Set expire to maximum messData.expireMinutes = 0; @@ -1451,9 +1451,9 @@ void SQRNetworkManager_Orbis::SendInviteGUI() // int ret = sce::Toolkit::NP::Messaging::Interface::sendMessage(&messData, SCE_TOOLKIT_NP_MESSAGE_TYPE_INVITE); free(subject); - free(body); + free(body); - if(ret < SCE_TOOLKIT_NP_SUCCESS ) + if(ret < SCE_TOOLKIT_NP_SUCCESS ) { s_bInviteDialogRunning = false; app.DebugPrintf("Send Message failed 0x%x ...\n",ret); @@ -1513,7 +1513,7 @@ void SQRNetworkManager_Orbis::TickInviteGUI() int32_t ret = sceGameCustomDataDialogGetResult( &dialogResult ); if( SCE_OK != ret ) - { + { app.DebugPrintf( "***** sceGameCustomDataDialogGetResult error:0x%x\n", ret); } sceGameCustomDataDialogClose(); @@ -1536,7 +1536,7 @@ void SQRNetworkManager_Orbis::GetInviteDataAndProcess(sce::Toolkit::NP::MessageA } // InvitationInfoRequest requestInfo; // sce::Toolkit::NP::Utilities::Future< NpSessionInvitationInfo > inviteInfo; -// +// // requestInfo.invitationId = pInvite->invitationId; // requestInfo.userInfo.npId = pInvite->onlineId; // int err = sce::Toolkit::NP::Sessions::Interface::getInvitationInfo(&requestInfo, &inviteInfo, false); @@ -1555,21 +1555,21 @@ void SQRNetworkManager_Orbis::GetInviteDataAndProcess(sce::Toolkit::NP::MessageA // { // app.DebugPrintf("getInvitationInfo error 0x%08x", err); // } -// -// -// +// +// +// // INVITE_INFO *invite = &m_inviteReceived[m_inviteIndex]; // m_inviteIndex = ( m_inviteIndex + 1 ) % MAX_SIMULTANEOUS_INVITES; // size_t dataSize = sizeof(INVITE_INFO); // int ret = sceNpBasicRecvMessageAttachmentLoad(id, invite, &dataSize); -// +// // // If we fail ( which we might do if we aren't online at this point) then zero the invite information and we'll try and get it later after (possibly) signing in // if( ret != 0 ) // { // memset(invite, 0, sizeof( INVITE_INFO ) ); // s_lastInviteIdToRetry = id; // } -// +// // m_gameBootInvite = invite; } @@ -1647,7 +1647,7 @@ void SQRNetworkManager_Orbis::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/) { EnterCriticalSection(&m_csRoomSyncData); - // If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal. + // If we pass an explicit roomSlotPlayerCount, it is because we are removing a player, and this is the count of slots that there were *before* the removal. bool zeroLastSlot = false; if( roomSlotPlayerCount == -1 ) { @@ -1751,7 +1751,7 @@ void SQRNetworkManager_Orbis::MapRoomSlotPlayers(int roomSlotPlayerCount/*=-1*/) } else { - FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId); + FindOrCreateNonNetworkPlayer( i, SQRNetworkPlayer::SNP_TYPE_REMOTE, m_roomSyncData.players[i].m_roomMemberId, m_roomSyncData.players[i].m_localIdx, m_roomSyncData.players[i].m_smallId); m_aRoomSlotPlayers[i]->SetUID(m_roomSyncData.players[i].m_UID); // On client, UIDs flow from m_roomSyncData->player data } } @@ -1844,7 +1844,7 @@ bool SQRNetworkManager_Orbis::AddRemotePlayersAndSync( SceNpMatching2RoomMemberI } // We want to keep all players from a particular machine together, so search through the room sync data to see if we can find - // any pre-existing players from this machine. + // any pre-existing players from this machine. int firstIdx = -1; for( int i = 0; i < m_roomSyncData.getPlayerCount(); i++ ) { @@ -1950,7 +1950,7 @@ void SQRNetworkManager_Orbis::RemoveRemotePlayersAndSync( SceNpMatching2RoomMemb // Update mapping from the room slot players to SQRNetworkPlayer instances MapRoomSlotPlayers(); - + // And then synchronise this out to all other machines SyncRoomData(); @@ -1993,7 +1993,7 @@ void SQRNetworkManager_Orbis::RemoveNetworkPlayers( int mask ) removePlayerFromVoiceChat(player); // Delete the player itself and the mapping from context to player map as this context is no longer valid - delete player; + delete player; } else { @@ -2107,7 +2107,7 @@ bool SQRNetworkManager_Orbis::GetMatchingContext(eSQRNetworkManagerInternalState // Starts the process of obtaining a server context. This is an asynchronous operation, at the end of which (if successful), we'll be creating // a room. General procedure followed here is as suggested by Sony - we get a list of servers, then pick a random one, and see if it is available. -// If not we just cycle round trying other random ones until we either find an available one or fail. +// If not we just cycle round trying other random ones until we either find an available one or fail. bool SQRNetworkManager_Orbis::GetServerContext() { assert(m_state == SNM_INT_STATE_IDLE); @@ -2165,7 +2165,7 @@ bool SQRNetworkManager_Orbis::GetServerContext(SceNpMatching2ServerId serverId) // ( serverCount == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) ) // Also checking for this as a means of simulating the previous error // { // sceNpMatching2DestroyContext(m_matchingContext); -// m_matchingContextValid = false; +// m_matchingContextValid = false; // if( !GetMatchingContext(SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT) ) return false; // } // } @@ -2298,7 +2298,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerConnectionComplete(SQRNetworkPlayer * if( ( !wasReady ) && ( isReady ) ) { - HandlePlayerJoined( player ); + HandlePlayerJoined( player ); } } @@ -2327,7 +2327,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerSmallIdAllocated(SQRNetworkPlayer *pl if( ( !wasReady ) && ( isReady ) ) { - HandlePlayerJoined( player ); + HandlePlayerJoined( player ); } } @@ -2345,7 +2345,7 @@ void SQRNetworkManager_Orbis::NetworkPlayerInitialDataReceived(SQRNetworkPlayer if( ( !wasReady ) && ( isReady ) ) { - HandlePlayerJoined( player ); + HandlePlayerJoined( player ); } } @@ -2361,7 +2361,7 @@ void SQRNetworkManager_Orbis::HandlePlayerJoined(SQRNetworkPlayer *player) { if( m_listener ) { - m_listener->HandlePlayerJoined( player ); + m_listener->HandlePlayerJoined( player ); } app.DebugPrintf(sc_verbose, ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> HandlePlayerJoined\n"); @@ -2425,7 +2425,7 @@ std::string getIPAddressString(SceNetInAddr add) { char str[32]; unsigned char *vals = (unsigned char*)&add.s_addr; - sprintf(str, "%d.%d.%d.%d", (int)vals[0], (int)vals[1], (int)vals[2], (int)vals[3]); + sprintf(str, "%d.%d.%d.%d", (int)vals[0], (int)vals[1], (int)vals[2], (int)vals[3]); return std::string(str); } @@ -2495,7 +2495,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro SQRVoiceConnection* pConnection = SonyVoiceChat_Orbis::getVoiceConnectionFromRoomMemberID(peerMemberId); if(pConnection == NULL) { - + // Create an Rudp context for the voice connection, this will happen regardless of whether the peer is client or host int rudpCtx; ret = sceRudpCreateContext( RudpContextCallback, this, &rudpCtx ); @@ -2510,7 +2510,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro g_numRUDPContextsBound++; app.DebugPrintf(sc_verbose, "-----------------::::::::::::: sceRudpBind\n" ); - ret = sceRudpInitiate( rudpCtx, (SceNetSockaddr*)&sinp2pPeer, sizeof(sinp2pPeer), 0); + ret = sceRudpInitiate( rudpCtx, (SceNetSockaddr*)&sinp2pPeer, sizeof(sinp2pPeer), 0); if(ret < 0){ app.DebugPrintf("sceRudpInitiate %s failed : 0x%08x\n", getIPAddressString(sinp2pPeer.sin_addr).c_str(), ret); assert(0); } if ( ( ret < 0 ) || ForceErrorPoint(SNM_FORCE_ERROR_RUDP_INIT2) ) return false; app.DebugPrintf(sc_verbose, "-----------------::::::::::::: sceRudpInitiate\n" ); @@ -2521,7 +2521,7 @@ bool SQRNetworkManager_Orbis::CreateVoiceRudpConnections(SceNpMatching2RoomId ro pConnection = SonyVoiceChat_Orbis::addRemoteConnection(rudpCtx, peerMemberId); } - + for( int i = 0; i < MAX_LOCAL_PLAYER_COUNT; i++ ) { bool bMaskVal = ( playerMask & ( 1 << i ) ); @@ -2544,11 +2544,11 @@ bool SQRNetworkManager_Orbis::CreateRudpConnections(SceNpMatching2RoomId roomId, memset(&sinp2pPeer, 0, sizeof(sinp2pPeer)); sinp2pPeer.sin_len = sizeof(sinp2pPeer); sinp2pPeer.sin_family = AF_INET; - + int ret = sceNpMatching2SignalingGetConnectionStatus(m_matchingContext, roomId, peerMemberId, &connStatus, &sinp2pPeer.sin_addr, &sinp2pPeer.sin_port); app.DebugPrintf(CMinecraftApp::USER_RR,"sceNpMatching2SignalingGetConnectionStatus returned 0x%x, connStatus %d peer add:%s peer port:0x%x\n",ret, connStatus,getIPAddressString(sinp2pPeer.sin_addr).c_str(),sinp2pPeer.sin_port); - // Set vport + // Set vport sinp2pPeer.sin_vport = sceNetHtons(1); // Create socket & bind, if we don't already have one @@ -2706,7 +2706,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp manager->m_state == SNM_INT_STATE_HOSTING_STARTING_MATCHING_CONTEXT || manager->m_state == SNM_INT_STATE_JOINING_STARTING_MATCHING_CONTEXT) { - // matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router + // matching context failed to start (this can happen when you block the IP addresses of the matching servers on your router // agent-0101.ww.sp-int.matching.playstation.net (198.107.157.191) // static-resource.sp-int.community.playstation.net (203.105.77.140) app.DebugPrintf("SQRNetworkManager_Orbis::ContextCallback - Error\n"); @@ -2771,7 +2771,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp // unsigned int type, attributes; // CellGameContentSize gameSize;` // char dirName[CELL_GAME_DIRNAME_SIZE]; -// +// // if( g_bBootedFromInvite ) // { // manager->GetInviteDataAndProcess(SCE_NP_BASIC_SELECTED_INVITATION_DATA); @@ -2789,7 +2789,7 @@ void SQRNetworkManager_Orbis::ContextCallback(SceNpMatching2ContextId id, SceNp assert(false); break; case SCE_NP_MATCHING2_CONTEXT_EVENT_START_OVER: - + app.DebugPrintf("SCE_NP_MATCHING2_CONTEXT_EVENT_START_OVER\n"); app.DebugPrintf("eventCause=%u, errorCode=0x%08x\n", eventCause, errorCode); @@ -2950,7 +2950,7 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id, if( success1 ) { success2 = manager->CreateRudpConnections(manager->m_room, pRoomMemberData->roomMemberDataInternal->memberId, playerMask, pRoomMemberData->roomMemberDataInternal->memberId); - if( success2 ) + if( success2 ) { bool ret = manager->CreateVoiceRudpConnections( manager->m_room, pRoomMemberData->roomMemberDataInternal->memberId, 0); assert(ret == true); @@ -3055,7 +3055,7 @@ void SQRNetworkManager_Orbis::DefaultRequestCallback(SceNpMatching2ContextId id, void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceNpMatching2RoomId roomId, SceNpMatching2Event event, const void *data, void *arg) { SQRNetworkManager_Orbis *manager = (SQRNetworkManager_Orbis *)arg; - + bool gotEventData = false; switch( event ) { @@ -3186,7 +3186,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN int oldMask = manager->GetOldMask( pRoomMemberData->newRoomMemberDataInternal->memberId ); int addedMask = manager->GetAddedMask(playerMask, oldMask ); int removedMask = manager->GetRemovedMask(playerMask, oldMask ); - + if( addedMask != 0 ) { bool success = manager->AddRemotePlayersAndSync( pRoomMemberData->newRoomMemberDataInternal->memberId, addedMask ); @@ -3203,7 +3203,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN memset(&reqParam, 0, sizeof(reqParam)); memset(&binAttr, 0, sizeof(binAttr)); - + binAttr.id = SCE_NP_MATCHING2_ROOMMEMBER_BIN_ATTR_INTERNAL_1_ID; binAttr.ptr = &oldMask; binAttr.size = sizeof(oldMask); @@ -3265,7 +3265,7 @@ void SQRNetworkManager_Orbis::RoomEventCallback(SceNpMatching2ContextId id, SceN } } } - + } } break; @@ -3426,7 +3426,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v // } // return; // } -// +// // if( netstart_result.result != 0 ) // { // // Failed, or user may have decided not to sign in - maybe need to differentiate here @@ -3440,7 +3440,7 @@ void SQRNetworkManager_Orbis::SysUtilCallback(uint64_t status, uint64_t param, v // s_SignInCompleteCallbackFn = NULL; // } // } -// +// // break; // case CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED: // break; @@ -3608,7 +3608,7 @@ void SQRNetworkManager_Orbis::NetCtlCallback(int eventType, void *arg) if( eventType == SCE_NET_CTL_EVENT_TYPE_DISCONNECTED)// CELL_NET_CTL_EVENT_LINK_DISCONNECTED ) { manager->m_bLinkDisconnected = true; - manager->m_listener->HandleDisconnect(false); + manager->m_listener->HandleDisconnect(false); } else //if( event == CELL_NET_CTL_EVENT_ESTABLISH ) { @@ -3762,7 +3762,7 @@ void SQRNetworkManager_Orbis::GetExtDataForRoom( SceNpMatching2RoomId roomId, vo if( ret == SCE_NP_MATCHING2_ERROR_CONTEXT_NOT_STARTED ) // Also checking for this as a means of simulating the previous error { sceNpMatching2DestroyContext(m_matchingContext); - m_matchingContextValid = false; + m_matchingContextValid = false; if( !GetMatchingContext(SNM_INT_STATE_IDLE_RECREATING_MATCHING_CONTEXT) ) { // No matching context, and failed to try and make one. We're really broken here. @@ -3789,7 +3789,7 @@ bool SQRNetworkManager_Orbis::ForceErrorPoint(eSQRForceError error) return false; } #else -bool SQRNetworkManager_Orbis::aForceError[SNM_FORCE_ERROR_COUNT] = +bool SQRNetworkManager_Orbis::aForceError[SNM_FORCE_ERROR_COUNT] = { false, // SNM_FORCE_ERROR_NP2_INIT false, // SNM_FORCE_ERROR_NET_INITIALIZE_NETWORK @@ -3919,7 +3919,7 @@ void SQRNetworkManager_Orbis::AttemptPSNSignIn(int (*SignInCompleteCallbackFn)(v ui.RequestMessageBox( IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA,1,iPad,ErrorPSNDisconnectedDialogReturned,pParam, app.GetStringTable()); } -} +} int SQRNetworkManager_Orbis::SetRichPresence(const void *data) { @@ -3971,13 +3971,13 @@ void SQRNetworkManager_Orbis::SendLastPresenceInfo() // On PS4 we can't set the status and the data at the same time unsigned int options = 0; - if( s_presenceDataDirty ) + if( s_presenceDataDirty ) { // Prioritise data over status as it is critical to discovering the network game s_lastPresenceInfo.presenceType = SCE_TOOLKIT_NP_PRESENCE_DATA; } - else if( s_presenceStatusDirty ) - { + else if( s_presenceStatusDirty ) + { s_lastPresenceInfo.presenceType = SCE_TOOLKIT_NP_PRESENCE_STATUS; } else @@ -4065,7 +4065,7 @@ void SQRNetworkManager_Orbis::removePlayerFromVoiceChat( SQRNetworkPlayer* pPlay { if(pPlayer->IsLocal()) { - + SonyVoiceChat_Orbis::disconnectLocalPlayer(pPlayer->GetLocalPlayerIndex()); } else @@ -4097,7 +4097,7 @@ void SQRNetworkManager_Orbis::removePlayerFromVoiceChat( SQRNetworkPlayer* pPlay void SQRNetworkManager_Orbis::TickNotify() { if (g_NetworkManager.IsInSession() && !g_NetworkManager.IsLocalGame()) - { + { long long currentTime = System::currentTimeMillis(); // Note: interval at which to notify Sony of realtime play, according to docs an interval greater than 1 sec is bad @@ -4109,7 +4109,7 @@ void SQRNetworkManager_Orbis::TickNotify() m_lastNotifyTime = currentTime; for(int i = 0; i < XUSER_MAX_COUNT; i++) { - if (ProfileManager.IsSignedInLive(i)) + if (ProfileManager.IsSignedInLive(i)) { NotifyRealtimePlusFeature(i); } @@ -4143,8 +4143,8 @@ void SQRNetworkManager_Orbis::NotifyRealtimePlusFeature(int iQuadrant) // { // app.DebugPrintf("============ Calling CallSignInCompleteCallback and s_SignInCompleteCallbackFn is OK\n"); // bool isSignedIn = ProfileManager.IsSignedInLive(s_SignInCompleteCallbackPad); -// -// s_SignInCompleteCallbackFn(s_SignInCompleteParam, isSignedIn, s_SignInCompleteCallbackPad); +// +// s_SignInCompleteCallbackFn(s_SignInCompleteParam, isSignedIn, s_SignInCompleteCallbackPad); // s_SignInCompleteCallbackFn = NULL; // s_SignInCompleteCallbackPad = -1; // } diff --git a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h index 5b19f63e..cb7cafa9 100644 --- a/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h +++ b/Minecraft.Client/Orbis/Network/SQRNetworkManager_Orbis.h @@ -29,7 +29,7 @@ class SQRNetworkManager_Orbis : public SQRNetworkManager public: SQRNetworkManager_Orbis(ISQRNetworkManagerListener *listener); - // General + // General void Tick(); void Initialise(); void Terminate(); @@ -111,7 +111,7 @@ private: bool m_offlineSQR; int m_resendExternalRoomDataCountdown; bool m_matching2initialised; - PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES]; + PresenceSyncInfo m_inviteReceived[MAX_SIMULTANEOUS_INVITES]; int m_inviteIndex; static PresenceSyncInfo *m_gameBootInvite; static PresenceSyncInfo m_gameBootInvite_data; @@ -222,9 +222,9 @@ private: std::vector m_aFriendSearchResults; // Rudp management and local players - std::unordered_map m_RudpCtxToPlayerMap; + std::unordered_map m_RudpCtxToPlayerMap; - std::unordered_map m_NetAddrToVoiceConnectionMap; + std::unordered_map m_NetAddrToVoiceConnectionMap; bool CreateRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask, SceNpMatching2RoomMemberId playersPeerMemberId); bool CreateVoiceRudpConnections(SceNpMatching2RoomId roomId, SceNpMatching2RoomMemberId peerMemberId, int playerMask); @@ -325,8 +325,8 @@ private: static sce::Toolkit::NP::PresenceDetails s_lastPresenceInfo; static const int MIN_PRESENCE_RESEND_TIME = 30 * 1000; // Minimum presence send rate - doesn't seem possible to find out what this actually should be - static __int64 s_lastPresenceTime; - static __int64 s_resendPresenceTime; + static int64_t s_lastPresenceTime; + static int64_t s_resendPresenceTime; static bool s_presenceStatusDirty; static bool s_presenceDataDirty; @@ -337,7 +337,7 @@ private: // Debug static long long s_roomStartTime; - + // Error dialog static bool s_errorDialogRunning; diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp index d3a21ac4..661a1528 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.cpp @@ -24,9 +24,9 @@ int32_t hBGMAudio; //static char sc_loadPath[] = {"/app0/"}; //const char* getConsoleHomePath() { return sc_loadPath; } -char* getUsrDirPath() -{ - return usrdirPath; +char* getUsrDirPath() +{ + return usrdirPath; } @@ -34,7 +34,7 @@ int _wcsicmp( const wchar_t * dst, const wchar_t * src ) { wchar_t f,l; - // validation section + // validation section // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); @@ -61,7 +61,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) } -VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) +VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) { SceRtcDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -78,8 +78,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) } BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { ORBIS_STUBBED; return false; } BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { ORBIS_STUBBED; return false; } -VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ +VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) +{ SceRtcDateTime dateTime; int err = sceRtcGetCurrentClockLocalTime(&dateTime); assert(err == SCE_OK ); @@ -95,21 +95,21 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) } HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { ORBIS_STUBBED; return NULL; } -VOID Sleep(DWORD dwMilliseconds) -{ +VOID Sleep(DWORD dwMilliseconds) +{ C4JThread::Sleep(dwMilliseconds); } BOOL SetThreadPriority(HANDLE hThread, int nPriority) { ORBIS_STUBBED; return FALSE; } DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { ORBIS_STUBBED; return false; } -LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) -{ +LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) +{ return sceAtomicCompareAndSwap32((int32_t*)Destination, (int32_t)Comperand, (int32_t)Exchange); } -LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) -{ +LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) +{ return sceAtomicCompareAndSwap64((int64_t*)Destination, (int64_t)Comperand, (int64_t)Exchange); } @@ -135,10 +135,10 @@ VOID OrbisInit() sceSysmoduleLoadModule(SCE_SYSMODULE_RUDP); sceSysmoduleLoadModule(SCE_SYSMODULE_NP_MATCHING2); sceSysmoduleLoadModule(SCE_SYSMODULE_INVITATION_DIALOG); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY ); - sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG ); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING ); - sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_PARTY ); + sceSysmoduleLoadModule(SCE_SYSMODULE_GAME_CUSTOM_DATA_DIALOG ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_SCORE_RANKING ); + sceSysmoduleLoadModule(SCE_SYSMODULE_NP_AUTH ); sceSysmoduleLoadModule(SCE_SYSMODULE_NP_COMMERCE); sceSysmoduleLoadModule(SCE_SYSMODULE_REMOTE_PLAY); sceSysmoduleLoadModule(SCE_SYSMODULE_ERROR_DIALOG); @@ -173,7 +173,7 @@ VOID OrbisInit() hBGMAudio=sceAudioOutOpen( SCE_USER_SERVICE_USER_ID_SYSTEM, SCE_AUDIO_OUT_PORT_TYPE_BGM,0, - 256, + 256, 48000, 2); @@ -195,7 +195,7 @@ int32_t GetAudioBGMHandle() return hBGMAudio; } -VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { char name[1] = {0}; @@ -209,7 +209,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) +VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) { InitializeCriticalSection(CriticalSection); } @@ -220,9 +220,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection) assert(err == SCE_OK); } -extern CRITICAL_SECTION g_singleThreadCS; +extern CRITICAL_SECTION g_singleThreadCS; -VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = scePthreadMutexLock(&CriticalSection->mutex); assert(err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK ); @@ -240,7 +240,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { if(--CriticalSection->m_cLock == 0 ) { @@ -255,7 +255,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) { - int err = scePthreadMutexTrylock(&CriticalSection->mutex); + int err = scePthreadMutexTrylock(&CriticalSection->mutex); if((err == SCE_OK || err == SCE_KERNEL_ERROR_EDEADLK )) { CriticalSection->m_cLock++; @@ -266,20 +266,20 @@ ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds) { ORBIS_STUBBED; return 0; } -BOOL CloseHandle(HANDLE hObject) -{ +BOOL CloseHandle(HANDLE hObject) +{ sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)hObject)); return true; -// ORBIS_STUBBED; -// return false; +// ORBIS_STUBBED; +// return false; } BOOL SetEvent(HANDLE hEvent) { ORBIS_STUBBED; return false; } HMODULE GetModuleHandle(LPCSTR lpModuleName) { ORBIS_STUBBED; return 0; } -DWORD GetCurrentThreadId(VOID) -{ +DWORD GetCurrentThreadId(VOID) +{ return 0; // TODO } DWORD WaitForMultipleObjectsEx(DWORD nCount,CONST HANDLE *lpHandles,BOOL bWaitAll,DWORD dwMilliseconds,BOOL bAlertable ) { ORBIS_STUBBED; return 0; } @@ -302,10 +302,10 @@ public: void* m_virtualAddr; uint64_t m_size; - PageInfo(off_t physAddr, void* virtualAddr, uint64_t size) + PageInfo(off_t physAddr, void* virtualAddr, uint64_t size) : m_physAddr(physAddr) , m_virtualAddr(virtualAddr) - , m_size(size) + , m_size(size) {} }; void* m_virtualAddr; @@ -313,7 +313,7 @@ public: std::vector m_pagesAllocated; uint64_t m_allocatedSize; - OrbisVAlloc(void* addr, uint64_t size) + OrbisVAlloc(void* addr, uint64_t size) : m_virtualAddr(addr) , m_virtualSize(size) , m_allocatedSize(0) @@ -331,7 +331,7 @@ public: { uint64_t sizeToAdd = size - m_allocatedSize; // the extra memory size that we have to add on assert(sizeToAdd >= 0); - + if(sizeToAdd == 0) return m_virtualAddr; // nothing to add @@ -393,8 +393,8 @@ public: static std::vector s_orbisVAllocs; -LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ +LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ if(lpAddress == NULL) { void *pAddr = (void*)SCE_KERNEL_APP_MAP_AREA_START_ADDR; @@ -446,14 +446,14 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) else if(dwFreeType == MEM_RELEASE) { delete s_orbisVAllocs[idx]; - s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx); + s_orbisVAllocs.erase(s_orbisVAllocs.begin()+idx); } return TRUE; } -DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) -{ +DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) +{ SceFiosSize FileSize; SceFiosFH fh = (SceFiosFH)((int64_t)hFile); //DWORD FileSizeLow; @@ -468,15 +468,15 @@ DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) return (DWORD)FileSize; } -BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize ) -{ +BOOL GetFileSizeEx(HANDLE hFile, PLARGE_INTEGER lpFileSize ) +{ SceFiosSize FileSize; SceFiosFH fh = (SceFiosFH)((int64_t)hFile); FileSize=sceFiosFHGetSize(fh); lpFileSize->QuadPart=FileSize; - return true; + return true; } BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped ) @@ -496,7 +496,7 @@ BOOL WriteFile( } } -BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) +BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) { SceFiosFH fh = (SceFiosFH)((int64_t)hFile); // sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes. @@ -537,7 +537,7 @@ BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHi } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -549,7 +549,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, strcpy(filePath, lpFileName ); else sprintf(filePath,"%s/%s",getUsrDirPath(), lpFileName ); - + #ifndef _CONTENT_PACKAGE app.DebugPrintf("*** Opening %s\n",filePath); #endif @@ -557,9 +557,9 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, SceFiosFH fh; SceFiosOpenParams openParams; ZeroMemory(&openParams, sizeof(SceFiosOpenParams)); - + switch(dwDesiredAccess) - { + { case GENERIC_READ: openParams.openFlags = SCE_FIOS_O_RDONLY; break; case GENERIC_WRITE: @@ -588,21 +588,21 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return INVALID_HANDLE_VALUE; } //assert( err == SCE_FIOS_OK ); - + return (void*)fh; } BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes){ ORBIS_STUBBED; return false; } BOOL DeleteFileA(LPCSTR lpFileName) { ORBIS_STUBBED; return false; } -// BOOL XCloseHandle(HANDLE a) +// BOOL XCloseHandle(HANDLE a) // { // sceFiosFHCloseSync(NULL,(SceFiosFH)((int64_t)a)); // return true; // } -DWORD GetFileAttributesA(LPCSTR lpFileName) +DWORD GetFileAttributesA(LPCSTR lpFileName) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -633,7 +633,7 @@ BOOL MoveFileA(LPCSTR lpExistingFileName, LPCSTR lpNewFileName) { ORBIS_STUBBED; DWORD GetLastError(VOID) { ORBIS_STUBBED; return 0; } -VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) +VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { SceLibcMallocManagedSize stat; int err = malloc_stats(&stat); @@ -647,20 +647,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) lpBuffer->dwAvailVirtual = stat.maxSystemSize - stat.currentInuseSize; } -DWORD GetTickCount() +DWORD GetTickCount() { - // This function returns the current system time at this function is called. + // This function returns the current system time at this function is called. // The system time is represented the time elapsed since the system starts up in microseconds. uint64_t sysTime = sceKernelGetProcessTime(); - return (DWORD)(sysTime / 1000); + return (DWORD)(sysTime / 1000); } // we should really use libperf for this kind of thing, but this will do for now. -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) -{ +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ // microseconds - lpFrequency->QuadPart = (1000 * 1000); - return false; + lpFrequency->QuadPart = (1000 * 1000); + return false; } BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { @@ -671,24 +671,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) #ifndef _FINAL_BUILD -VOID OutputDebugStringW(LPCWSTR lpOutputString) -{ - wprintf(lpOutputString); +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + wprintf(lpOutputString); } -VOID OutputDebugStringA(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + printf(lpOutputString); } -VOID OutputDebugString(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugString(LPCSTR lpOutputString) +{ + printf(lpOutputString); } #endif // _CONTENT_PACKAGE BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation) -{ +{ ORBIS_STUBBED; return false; } @@ -696,15 +696,15 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { ORB BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { ORBIS_STUBBED; return false;} errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } -DWORD XGetLanguage() -{ +DWORD XGetLanguage() +{ unsigned char ucLang = app.GetMinecraftLanguage(0); int iLang; // check if we should override the system language or not - if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) + if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) { sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang); } @@ -747,8 +747,8 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() -{ +DWORD XGetLocale() +{ int iLang; sceSystemServiceParamGetInt(SCE_SYSTEM_SERVICE_PARAM_ID_LANG,&iLang); switch(iLang) @@ -784,7 +784,7 @@ DWORD XGetLocale() } } -DWORD XEnableGuestSignin(BOOL fEnable) -{ - return 0; +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; } \ No newline at end of file diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h index da9f872f..390a0897 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisStubs.h @@ -14,7 +14,7 @@ DWORD TlsAlloc(VOID); LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -37,16 +37,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -214,7 +214,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -256,17 +256,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -286,38 +286,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -356,9 +356,9 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h index 006a0060..a4c19219 100644 --- a/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h +++ b/Minecraft.Client/Orbis/OrbisExtras/OrbisTypes.h @@ -34,8 +34,6 @@ typedef unsigned int *PUINT; typedef unsigned char byte; -typedef long __int64; -typedef unsigned long __uint64; typedef unsigned int DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; diff --git a/Minecraft.Client/Orbis/Orbis_App.cpp b/Minecraft.Client/Orbis/Orbis_App.cpp index 9af5ee12..8c674a47 100644 --- a/Minecraft.Client/Orbis/Orbis_App.cpp +++ b/Minecraft.Client/Orbis/Orbis_App.cpp @@ -35,7 +35,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() m_bVoiceChatAndUGCRestricted=false; m_bDisplayFullVersionPurchase=false; - // #ifdef _DEBUG_MENUS_ENABLED + // #ifdef _DEBUG_MENUS_ENABLED // debugOverlayCreated = false; // #endif @@ -333,7 +333,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo) DWORD dwHigh=0; pDLCInfo->dwImageBytes = GetFileSize(hFile,&dwHigh); - + if(pDLCInfo->dwImageBytes!=0) { DWORD dwBytesRead; @@ -400,7 +400,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __int64 seedValue = 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_t seedValue = 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 NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -485,7 +485,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_GetProductList: - { + { m_eCommerce_State=eCommerce_State_GetProductList_Pending; SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); std::list::iterator iter = pCategories->subCategories.begin(); @@ -501,7 +501,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_AddProductInfoDetailed: - { + { m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending; // for each of the products in the categories, get the detailed info. We really only need the long description and price info. @@ -538,7 +538,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_RegisterDLC: - { + { m_eCommerce_State=eCommerce_State_Online; // register the DLC info SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); @@ -625,20 +625,20 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo() return &m_CategoryInfo; } -#endif +#endif void CConsoleMinecraftApp::ClearCommerceDetails() { #ifdef ORBIS_COMMERCE_ENABLED for(int i=0;i* pProductList=&m_ProductListA[i]; + std::vector* pProductList=&m_ProductListA[i]; pProductList->clear(); } if(m_ProductListA!=NULL) { - delete [] m_ProductListA; + delete [] m_ProductListA; m_ProductListA=NULL; } @@ -674,11 +674,11 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchDLCProductID,Info.productId)==0) - { + { memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN); return; } - } + } } } return; @@ -689,7 +689,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch void CConsoleMinecraftApp::Checkout(char *pchSkuID) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,pchSkuID); m_eCommerce_State=eCommerce_State_Checkout; } @@ -698,7 +698,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID) void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,pchSkuID); m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased; } @@ -707,7 +707,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) bool CConsoleMinecraftApp::UpgradeTrial() { if(m_eCommerce_State==eCommerce_State_Online) - { + { m_eCommerce_State=eCommerce_State_UpgradeTrial; return true; } @@ -749,12 +749,12 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) // { // std::vector* pProductList=&m_ProductListA[i]; // AUTO_VAR(itEnd, pProductList->end()); -// +// // for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++) // { // SonyCommerce::ProductInfo Info=*it; // if(strcmp(pchTitle,Info.skuId)==0) -// { +// { // ORBIS_STUBBED; // SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF // // if(Info.purchasabilityFlag==SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF) @@ -766,7 +766,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) // // return false; // // } // } -// } +// } // } // } #endif // #ifdef ORBIS_COMMERCE_ENABLED @@ -804,7 +804,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err) if(err==0) { pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories; - // allocate the memory for the product info for each categories + // allocate the memory for the product info for each categories if(pClass->m_CategoryInfo.countOfSubCategories>0) { pClass->m_ProductListA = (std::vector *) new std::vector [pClass->m_CategoryInfo.countOfSubCategories]; @@ -838,7 +838,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err { // we're done, so now retrieve the additional product details for each product pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } else { @@ -848,21 +848,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } } // void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err) // { // CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam; -// +// // if(err==0) // { // pScene->m_eCommerce_State=eCommerce_State_Idle; -// //pScene->m_bCommerceProductListRetrieved=true; +// //pScene->m_bCommerceProductListRetrieved=true; // } // //printf("Callback hit, error 0x%08x\n", err); -// +// // } void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err) @@ -882,7 +882,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // MGH - change this to a while loop so we can skip empty categories. do - { + { pClass->m_iCurrentCategory++; }while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategorym_ProductListCategoriesC); @@ -891,12 +891,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // there are no more categories, so we're done pClass->m_eCommerce_State=eCommerce_State_RegisterDLC; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; } else { // continue with the next category - pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; + pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; } } else @@ -908,7 +908,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; pClass->m_iCurrentProduct=0; pClass->m_iCurrentCategory=0; } @@ -1062,9 +1062,9 @@ void CConsoleMinecraftApp::SystemServiceTick() for (int i = 0; i < status.eventNum; i++) { ret = sceSystemServiceReceiveEvent(&event); - if (ret == SCE_OK) + if (ret == SCE_OK) { - switch(event.eventType) + switch(event.eventType) { case SCE_SYSTEM_SERVICE_EVENT_GAME_CUSTOM_DATA: { @@ -1072,7 +1072,7 @@ void CConsoleMinecraftApp::SystemServiceTick() // Processing after invitation //SceNpSessionInvitationEventParam* pInvite = (SceNpSessionInvitationEventParam*)event.data.param; //SQRNetworkManager_Orbis::GetInviteDataAndProcess(pInvite); - break; + break; } case SCE_SYSTEM_SERVICE_EVENT_ON_RESUME: // Resume means that the user signed out (but came back), sensible thing to do is exit to main menu @@ -1217,7 +1217,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad) bool bEmptyStore=true; if(pCategories!=NULL) - { + { if(pCategories->countOfProducts>0) { bEmptyStore=false; @@ -1247,7 +1247,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad) void CConsoleMinecraftApp::ShowPatchAvailableError() { int32_t ret=sceErrorDialogInitialize(); - if ( ret==SCE_OK ) + if ( ret==SCE_OK ) { m_bPatchAvailableDialogRunning = true; @@ -1256,7 +1256,7 @@ void CConsoleMinecraftApp::ShowPatchAvailableError() // 4J-PB - We want to display the option to get the patch now param.errorCode = SCE_NP_ERROR_LATEST_PATCH_PKG_DOWNLOADED; ret = sceUserServiceGetInitialUser( ¶m.userId ); - if ( ret == SCE_OK ) + if ( ret == SCE_OK ) { ret=sceErrorDialogOpen( ¶m ); } @@ -1266,9 +1266,9 @@ void CConsoleMinecraftApp::ShowPatchAvailableError() void CConsoleMinecraftApp::PatchAvailableDialogTick() { if(m_bPatchAvailableDialogRunning) - { + { SceErrorDialogStatus stat = sceErrorDialogUpdateStatus(); - if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED ) + if( stat == SCE_ERROR_DIALOG_STATUS_FINISHED ) { sceErrorDialogTerminate(); diff --git a/Minecraft.Client/Orbis/user_malloc.cpp b/Minecraft.Client/Orbis/user_malloc.cpp index 6a85e83b..1628abbe 100644 --- a/Minecraft.Client/Orbis/user_malloc.cpp +++ b/Minecraft.Client/Orbis/user_malloc.cpp @@ -38,7 +38,7 @@ int user_malloc_init(void) int res; void *addr; uint64_t dmemSize = SCE_KERNEL_MAIN_DMEM_SIZE; - + s_heapLength = ((size_t)4608) * 1024 * 1024; // Initial allocation for the application s_heapLength -= ((size_t)4) * 1024 * 1024; // Allocated for TLS s_heapLength -= ((size_t)2) * 1024 * 1024; // 64K (sometimes?) allocated for razor - rounding up to 2MB here to match our alignment @@ -106,10 +106,10 @@ void *user_malloc(size_t size) { #if 0 static int throttle = 0; - static __int64 lasttime = 0; + static int64_t lasttime = 0; if( ( throttle % 100 ) == 0 ) { - __int64 nowtime = System::currentTimeMillis(); + int64_t nowtime = System::currentTimeMillis(); if( ( nowtime - lasttime ) > 20000 ) { lasttime = nowtime; diff --git a/Minecraft.Client/PS3/Iggy/include/rrCore.h b/Minecraft.Client/PS3/Iggy/include/rrCore.h index e88b5f8c..ae02f108 100644 --- a/Minecraft.Client/PS3/Iggy/include/rrCore.h +++ b/Minecraft.Client/PS3/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((uint64_t)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PS3/Miles/include/mss.h b/Minecraft.Client/PS3/Miles/include/mss.h index 531dcbc9..754f536b 100644 --- a/Minecraft.Client/PS3/Miles/include/mss.h +++ b/Minecraft.Client/PS3/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef uint64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the byte size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/PS3/Miles/include/rrCore.h b/Minecraft.Client/PS3/Miles/include/rrCore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/PS3/Miles/include/rrCore.h +++ b/Minecraft.Client/PS3/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp index bdd58e17..e1d8dffa 100644 --- a/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp +++ b/Minecraft.Client/PS3/Network/SonyRemoteStorage_PS3.cpp @@ -27,21 +27,21 @@ void SonyRemoteStorage_PS3::npauthhandler(int event, int result, void *arg) { #ifdef __PS3__ - if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0) + if (event != SCE_NP_MANAGER_EVENT_GOT_TICKET || result <= 0) { app.DebugPrintf("Could not retrieve ticket: 0x%x\n", result); - } - else + } + else { psnTicketSize = result; psnTicket = malloc(psnTicketSize); - if (psnTicket == NULL) + if (psnTicket == NULL) { app.DebugPrintf("Failed to allocate for ticket\n"); } int ret = sceNpManagerGetTicket(psnTicket, &psnTicketSize); - if (ret < 0) + if (ret < 0) { app.DebugPrintf("Could not retrieve ticket: 0x%x\n", ret); free(psnTicket); @@ -60,7 +60,7 @@ int SonyRemoteStorage_PS3::initPreconditions() SceNpId npId; ret = sceNpManagerGetNpId(&npId); - if(ret < 0) + if(ret < 0) { return ret; } @@ -68,12 +68,12 @@ int SonyRemoteStorage_PS3::initPreconditions() ticketVersion.major = 3; ticketVersion.minor = 0; ret = sceNpManagerRequestTicket2(&npId, &ticketVersion, TICKETING_SERVICE_ID, NULL, 0, NULL, 0); - if(ret < 0) + if(ret < 0) { return ret; } m_waitingForTicket = true; - while(m_waitingForTicket) + while(m_waitingForTicket) { cellSysutilCheckCallback(); sys_timer_usleep(50000); //50 milliseconds. @@ -104,12 +104,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case GET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Data success \n"); m_status = e_getDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -126,12 +126,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case GET_STATUS_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Status success \n"); app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs); app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles); - for(int i = 0; i < outputGetStatus->numFiles; i++) + for(int i = 0; i < outputGetStatus->numFiles; i++) { app.DebugPrintf("\n*** File %d information: ***\n", (i + 1)); app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName); @@ -142,8 +142,8 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write")); } m_status = e_getStatusSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -158,12 +158,12 @@ void SonyRemoteStorage_PS3::internalCallback(const SceRemoteStorageEvent event, break; case SET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Set Data success \n"); m_status = e_setDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -230,7 +230,7 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam) params.callback = staticInternalCallback; params.userData = this; params.thread.threadAffinity = 0; //Not used in PS3 - params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest. + params.thread.threadPriority = 1000; //Must be between [0-3071], being 0 the highest. params.psnTicket = psnTicket; params.psnTicketSize = psnTicketSize; strcpy(params.clientId, CLIENT_ID); @@ -246,20 +246,20 @@ bool SonyRemoteStorage_PS3::init(CallbackFunc cb, LPVOID lpParam) // SceRemoteStorageAbortReqParams abortParams; ret = sceRemoteStorageInit(params); - if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED) + if(ret >= 0 || ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED) { // abortParams.requestId = ret; //ret = sceRemoteStorageAbort(abortParams); app.DebugPrintf("Session will be created \n"); - //if(ret >= 0) + //if(ret >= 0) //{ // printf("Session aborted \n"); - //} else + //} else //{ // printf("Error aborting session: 0x%x \n", ret); //} - } - else + } + else { app.DebugPrintf("Error creating session: 0x%x \n", ret); return false; @@ -279,12 +279,12 @@ bool SonyRemoteStorage_PS3::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, Cal reqId = sceRemoteStorageGetStatus(params, outputGetStatus); m_status = e_getStatusInProgress; - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Status request sent \n"); return true; - } - else + } + else { app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId); return false; @@ -303,11 +303,11 @@ void SonyRemoteStorage_PS3::abort() params.requestId = reqId; int ret = sceRemoteStorageAbort(params); - if(ret >= 0) + if(ret >= 0) { app.DebugPrintf("Abort request done \n"); - } - else + } + else { app.DebugPrintf("Error in Abort request: 0x%x \n", ret); } @@ -345,7 +345,7 @@ bool SonyRemoteStorage_PS3::setDataInternal() char seed[22]; app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack); - __int64 iSeed = strtoll(seed,NULL,10); + int64_t iSeed = strtoll(seed,NULL,10); char seedHex[17]; sprintf(seedHex,"%016llx",iSeed); memcpy(descData.m_seed,seedHex,16); // Don't copy null @@ -377,14 +377,14 @@ bool SonyRemoteStorage_PS3::setDataInternal() reqId = sceRemoteStorageSetData(params); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Set Data request sent \n"); m_bTransferStarted = true; m_status = e_setDataInProgress; return true; - } - else + } + else { app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId); return false; @@ -406,12 +406,12 @@ bool SonyRemoteStorage_PS3::getData( const char* remotePath, const char* localPa reqId = sceRemoteStorageGetData(params, &outputGetData); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Data request sent \n"); m_bTransferStarted = true; m_status = e_getDataInProgress; - } else + } else { app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId); } diff --git a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h index 134059db..9365458d 100644 --- a/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h +++ b/Minecraft.Client/PS3/PS3Extras/HeapInspector/Server/HeapInspectorServerTypes.h @@ -16,8 +16,8 @@ typedef unsigned int uint32; typedef unsigned long long uint64; typedef long long int64; #else - typedef unsigned __int64 uint64; - typedef __int64 int64; + typedef uint64_t uint64; + typedef int64_t int64; #endif typedef char int8; diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp index 47cd7106..8387868f 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #undef __in #undef __out #include @@ -31,49 +31,49 @@ vector vOpenFileHandles; namespace boost { void assertion_failed(char const * expr, - char const * function, char const * file, long line) - { + char const * function, char const * file, long line) + { #ifndef _CONTENT_PACKAGE - printf("Assert failed!!!\n"); - printf(expr); - printf("\n"); - printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line); + printf("Assert failed!!!\n"); + printf(expr); + printf("\n"); + printf("----------------------\n %s failed. File %s at line %d \n----------------------\n", function, file, line); snPause(); #endif } // user defined } // namespace boost - char* getConsoleHomePath() - { - return contentInfoPath; + char* getConsoleHomePath() + { + return contentInfoPath; } -char* getUsrDirPath() -{ - return usrdirPath; +char* getUsrDirPath() +{ + return usrdirPath; } -char* getConsoleHomePathBDPatch() -{ - return contentInfoPathBDPatch; +char* getConsoleHomePathBDPatch() +{ + return contentInfoPathBDPatch; } -char* getUsrDirPathBDPatch() -{ - return usrdirPathBDPatch; +char* getUsrDirPathBDPatch() +{ + return usrdirPathBDPatch; } -char* getDirName() -{ - return dirName; +char* getDirName() +{ + return dirName; } int _wcsicmp( const wchar_t * dst, const wchar_t * src ) { wchar_t f,l; - // validation section + // validation section // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); @@ -101,7 +101,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) Cnullptr nullptr; -VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) +VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) { CellRtcDateTime dateTime; int err = cellRtcGetCurrentClock(&dateTime, 0); @@ -118,8 +118,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) } BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { PS3_STUBBED; return false; } BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) { PS3_STUBBED; return false; } -VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ +VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) +{ CellRtcDateTime dateTime; int err = cellRtcGetCurrentClockLocalTime(&dateTime); assert(err == CELL_OK); @@ -135,26 +135,26 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) } HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PS3_STUBBED; return NULL; } -VOID Sleep(DWORD dwMilliseconds) -{ +VOID Sleep(DWORD dwMilliseconds) +{ C4JThread::Sleep(dwMilliseconds); } BOOL SetThreadPriority(HANDLE hThread, int nPriority) { PS3_STUBBED; return FALSE; } DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { PS3_STUBBED; return false; } -LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) -{ +LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) +{ return cellAtomicCompareAndSwap32((uint32_t*)Destination, (uint32_t)Comperand, (uint32_t)Exchange); } -LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) -{ +LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) +{ return cellAtomicCompareAndSwap64((uint64_t*)Destination, (uint64_t)Comperand, (uint64_t)Exchange); } -VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { sys_lwmutex_attribute_t attr; // from the defaults in sys_lwmutex_attribute_initialize @@ -167,7 +167,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) +VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) { // no spin count on PS3 InitializeCriticalSection(CriticalSection); @@ -179,9 +179,9 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection) PS3_ASSERT_CELL_ERROR(err); } -extern CRITICAL_SECTION g_singleThreadCS; +extern CRITICAL_SECTION g_singleThreadCS; -VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) { // if(CriticalSection != &g_singleThreadCS &&(C4JThread::isMainThread() == false) ) // LeaveCriticalSection(&g_singleThreadCS); @@ -192,7 +192,7 @@ VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = sys_lwmutex_unlock(CriticalSection); PS3_ASSERT_CELL_ERROR(err); @@ -200,7 +200,7 @@ VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) ULONG TryEnterCriticalSection(PCRITICAL_SECTION CriticalSection) { - int err = sys_lwmutex_trylock(CriticalSection); + int err = sys_lwmutex_trylock(CriticalSection); if(err == CELL_OK) return true; return false; @@ -209,8 +209,8 @@ DWORD WaitForMultipleObjects(DWORD nCount, CONST HANDLE *lpHandles,BOOL bWaitAll -BOOL CloseHandle(HANDLE hObject) -{ +BOOL CloseHandle(HANDLE hObject) +{ if(hObject==INVALID_HANDLE_VALUE) { //printf("\n\nTRYING TO CLOSE AN INVALID FILE HANDLE\n\n"); @@ -219,7 +219,7 @@ BOOL CloseHandle(HANDLE hObject) else { CellFsErrno err; - err=cellFsClose(int(hObject)); + err=cellFsClose(int(hObject)); if(err==CELL_FS_SUCCEEDED) { iFilesOpen--; @@ -235,7 +235,7 @@ BOOL CloseHandle(HANDLE hObject) } } //printf("\n\nFiles Open - %d\n\n",iFilesOpen); - return true; + return true; } else { @@ -249,8 +249,8 @@ BOOL SetEvent(HANDLE hEvent) { PS3_STUBBED; return false; } HMODULE GetModuleHandle(LPCSTR lpModuleName) { PS3_STUBBED; return 0; } -sys_ppu_thread_t GetCurrentThreadId(VOID) -{ +sys_ppu_thread_t GetCurrentThreadId(VOID) +{ sys_ppu_thread_t id; int err = sys_ppu_thread_get_id(&id); PS3_ASSERT_CELL_ERROR(err); @@ -264,8 +264,8 @@ BOOL TlsFree(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->Free(dwTlsInd LPVOID TlsGetValue(DWORD dwTlsIndex) { return TLSStoragePS3::Instance()->GetValue(dwTlsIndex); } BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return TLSStoragePS3::Instance()->SetValue(dwTlsIndex, lpTlsValue); } -LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ +LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ int err; sys_addr_t newAddress = NULL; if(lpAddress == NULL) @@ -299,7 +299,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO return (LPVOID)newAddress; } -BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) +BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) { if(dwFreeType == MEM_DECOMMIT) { @@ -307,12 +307,12 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) sys_vm_statistics_t stat; err = sys_vm_get_statistics((sys_addr_t)lpAddress, &stat); PS3_ASSERT(err == CELL_OK); - + // 4J Stu - We can only return what we have actually committed on PS3 // From PS3 Docs: // The maximum amount of memory that can be returned is the difference of the total amount of physical memory used by the virtual memory area minus 1MB. When an amount exceeding this value is specified, EBUSY will return. SIZE_T memToFree = stat.pmem_total - (1024 * 1024); - if(dwSize < memToFree) + if(dwSize < memToFree) memToFree = dwSize; app.DebugPrintf("VirtualFree: Requested size - %d, Actual size - %d\n", dwSize, memToFree); @@ -349,10 +349,10 @@ BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPD uint64_t bytesWritten; CellFsErrno err = cellFsWrite(fd, lpBuffer, nNumberOfBytesToWrite, &bytesWritten); *lpNumberOfBytesWritten = (DWORD)bytesWritten; - return (err == CELL_FS_OK); + return (err == CELL_FS_OK); } -BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) +BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) { int fd = (int)hFile; uint64_t bytesRead; @@ -374,7 +374,7 @@ BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD break; } - return (err==CELL_FS_SUCCEEDED); + return (err==CELL_FS_SUCCEEDED); } BOOL SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) @@ -407,7 +407,7 @@ void replaceBackslashes(char* szFilename) } } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { char filePath[256]; std::string mountedPath; @@ -445,7 +445,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, int fd = 0; int flags = 0; switch(dwDesiredAccess) - { + { case GENERIC_READ: flags = CELL_FS_O_RDONLY; break; case GENERIC_WRITE: @@ -508,7 +508,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, switch(err) { case CELL_FS_SUCCEEDED: - { + { app.DebugPrintf("CELL_FS_SUCCEEDED\n"); DWORD dwFileSize = (DWORD)statData.st_size; @@ -522,7 +522,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, // fd is invalid or the file system on a removable media has been unmounted // When cellFsFstat() returns CELL_FS_EBADF, it can be deduced that the above error occurred because a disc was ejected. - // Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose(). + // Explicitly call cellFsClose() and close the applicable file. When using stream supporting APIs, call cellFsStReadFinish() before calling cellFsClose(). app.DebugPrintf("CELL_FS_EBADF\n"); CloseHandle((HANDLE)fd); @@ -531,7 +531,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, //ShutdownManager::StartShutdown(); return INVALID_HANDLE_VALUE; - + case CELL_FS_EIO: app.DebugPrintf("CELL_FS_EIO\n"); break; @@ -550,8 +550,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return (void*)fd; } -BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ +BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ char filePath[256]; sprintf(filePath,"%s/%s",usrdirPath, lpPathName ); CellFsErrno err = cellFsMkdir(filePath, CELL_FS_DEFAULT_CREATE_MODE_1); @@ -563,12 +563,12 @@ BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribu BOOL DeleteFileA(LPCSTR lpFileName) { PS3_STUBBED; return false; } -// BOOL XCloseHandle(HANDLE a) -// { -// cellFsClose(int(a)); +// BOOL XCloseHandle(HANDLE a) +// { +// cellFsClose(int(a)); // } -DWORD GetFileAttributesA(LPCSTR lpFileName) +DWORD GetFileAttributesA(LPCSTR lpFileName) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -582,7 +582,7 @@ DWORD GetFileAttributesA(LPCSTR lpFileName) sprintf(filePath,"%s/%s",usrdirPath, lpFileName ); // set to load from host //strcat(filePath,".edat"); - + //printf("GetFileAttributesA - %s\n",filePath); // check if the file exists first @@ -606,7 +606,7 @@ VOID DebugBreak(VOID) { snPause(); } DWORD GetLastError(VOID) { PS3_STUBBED; return 0; } -VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) +VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { malloc_managed_size stat; int err = malloc_stats(&stat); @@ -620,20 +620,20 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) lpBuffer->dwAvailVirtual = stat.max_system_size - stat.current_inuse_size; } -DWORD GetTickCount() +DWORD GetTickCount() { - // This function returns the current system time at this function is called. + // This function returns the current system time at this function is called. // The system time is represented the time elapsed since the system starts up in microseconds. system_time_t sysTime = sys_time_get_system_time(); - return sysTime / 1000; + return sysTime / 1000; } // we should really use libperf for this kind of thing, but this will do for now. -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) -{ +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ // microseconds - lpFrequency->QuadPart = (1000 * 1000); - return false; + lpFrequency->QuadPart = (1000 * 1000); + return false; } BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { @@ -646,24 +646,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) } #ifndef _FINAL_BUILD -VOID OutputDebugStringW(LPCWSTR lpOutputString) -{ - wprintf(lpOutputString); +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + wprintf(lpOutputString); } -VOID OutputDebugString(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugString(LPCSTR lpOutputString) +{ + printf(lpOutputString); } -VOID OutputDebugStringA(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + printf(lpOutputString); } #endif // _CONTENT_PACKAGE BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation) -{ +{ PS3_STUBBED; return false; } @@ -671,7 +671,7 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) { PS3 BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) { PS3_STUBBED; return false;} errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } int _wtoi(const wchar_t *_Str) { @@ -680,13 +680,13 @@ int _wtoi(const wchar_t *_Str) -DWORD XGetLanguage() -{ +DWORD XGetLanguage() +{ unsigned char ucLang = app.GetMinecraftLanguage(0); int iLang; // check if we should override the system language or not - if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) + if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) { cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang); } @@ -701,7 +701,7 @@ DWORD XGetLanguage() case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LANGUAGE_ENGLISH; case CELL_SYSUTIL_LANG_FRENCH : return XC_LANGUAGE_FRENCH; - case CELL_SYSUTIL_LANG_SPANISH : + case CELL_SYSUTIL_LANG_SPANISH : if(app.IsAmericanSKU()) { return XC_LANGUAGE_LATINAMERICANSPANISH; @@ -714,7 +714,7 @@ DWORD XGetLanguage() case CELL_SYSUTIL_LANG_GERMAN : return XC_LANGUAGE_GERMAN; case CELL_SYSUTIL_LANG_ITALIAN : return XC_LANGUAGE_ITALIAN; case CELL_SYSUTIL_LANG_PORTUGUESE_PT : return XC_LANGUAGE_PORTUGUESE; - + case CELL_SYSUTIL_LANG_RUSSIAN : return XC_LANGUAGE_RUSSIAN; case CELL_SYSUTIL_LANG_KOREAN : return XC_LANGUAGE_KOREAN; case CELL_SYSUTIL_LANG_CHINESE_T : return XC_LANGUAGE_TCHINESE; @@ -735,8 +735,8 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() -{ +DWORD XGetLocale() +{ int iLang; cellSysutilGetSystemParamInt(CELL_SYSUTIL_SYSTEMPARAM_ID_LANG,&iLang); switch(iLang) @@ -745,7 +745,7 @@ DWORD XGetLocale() case CELL_SYSUTIL_LANG_ENGLISH_US : return XC_LOCALE_UNITED_STATES; case CELL_SYSUTIL_LANG_FRENCH : return XC_LOCALE_FRANCE; - case CELL_SYSUTIL_LANG_SPANISH : + case CELL_SYSUTIL_LANG_SPANISH : if(app.IsAmericanSKU()) { return XC_LOCALE_LATIN_AMERICA; @@ -753,7 +753,7 @@ DWORD XGetLocale() else { return XC_LOCALE_SPAIN; - } + } return XC_LOCALE_SPAIN; case CELL_SYSUTIL_LANG_GERMAN : return XC_LOCALE_GERMANY; @@ -777,11 +777,11 @@ DWORD XGetLocale() case CELL_SYSUTIL_LANG_CHINESE_S : return XC_LOCALE_CHINA; default : return XC_LOCALE_UNITED_STATES; - } + } } -DWORD XEnableGuestSignin(BOOL fEnable) -{ - return 0; +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; } #endif // __PS3__ diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h index f24a3b92..8f1b489d 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Stubs.h @@ -29,7 +29,7 @@ LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -53,16 +53,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -219,7 +219,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -261,17 +261,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -291,38 +291,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -364,11 +364,11 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix); int _wtoi(const wchar_t *_Str); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h index b6cf351d..ade37607 100644 --- a/Minecraft.Client/PS3/PS3Extras/Ps3Types.h +++ b/Minecraft.Client/PS3/PS3Extras/Ps3Types.h @@ -35,22 +35,22 @@ using boost::hash; // user the pool_allocator for all unordered_set and unordered_map instances -// template < class T, class H = hash, class P = std::equal_to, class A = boost::pool_allocator > -// class unordered_set : public std::tr1::unordered_set +// template < class T, class H = hash, class P = std::equal_to, class A = boost::pool_allocator > +// class unordered_set : public std::tr1::unordered_set // {}; -// -// template , class P = std::equal_to, class A = boost::pool_allocator > > -// class unordered_map : public std::tr1::unordered_map +// +// template , class P = std::equal_to, class A = boost::pool_allocator > > +// class unordered_map : public std::tr1::unordered_map // {}; -// template < class T, class H = hash, class P = std::equal_to, class A = C4JPoolAllocator > -// class unordered_set : public std::tr1::unordered_set +// template < class T, class H = hash, class P = std::equal_to, class A = C4JPoolAllocator > +// class unordered_set : public std::tr1::unordered_set // {}; -// -// template , class P = std::equal_to, class A = C4JPoolAllocator > > -// class unordered_map : public std::tr1::unordered_map +// +// template , class P = std::equal_to, class A = C4JPoolAllocator > > +// class unordered_map : public std::tr1::unordered_map // {}; @@ -111,21 +111,19 @@ typedef unsigned int *PUINT; typedef unsigned char byte; -typedef long long __int64; -typedef unsigned long long __uint64; typedef unsigned long DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef __int64 LONG64, *PLONG64; +typedef int64_t LONG64, *PLONG64; #define VOID void typedef char CHAR; typedef short SHORT; typedef long LONG; -typedef __int64 LONGLONG; -typedef __uint64 ULONGLONG; +typedef long long LONGLONG; +typedef unsigned long long ULONGLONG; #define CONST const diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/detail/polymorphic_iarchive_route.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/detail/polymorphic_iarchive_route.hpp index d93bb79c..f46a1681 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/detail/polymorphic_iarchive_route.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/detail/polymorphic_iarchive_route.hpp @@ -138,10 +138,10 @@ private: ArchiveImplementation::load(t); } #elif defined(BOOST_HAS_MS_INT64) - virtual void load(__int64 & t){ + virtual void load(int64_t & t){ ArchiveImplementation::load(t); } - virtual void load(unsigned __int64 & t){ + virtual void load(uint64_t & t){ ArchiveImplementation::load(t); } #endif @@ -187,7 +187,7 @@ public: } // register type function template - const basic_pointer_iserializer * + const basic_pointer_iserializer * register_type(T * t = NULL){ return ArchiveImplementation::register_type(t); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp index 2f76cf26..ce780c84 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_iarchive.hpp @@ -17,7 +17,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include // std::size_t -#include // ULONG_MAX +#include // ULONG_MAX #include #include @@ -83,8 +83,8 @@ public: virtual void load(boost::long_long_type & t) = 0; virtual void load(boost::ulong_long_type & t) = 0; #elif defined(BOOST_HAS_MS_INT64) - virtual void load(__int64 & t) = 0; - virtual void load(unsigned __int64 & t) = 0; + virtual void load(int64_t & t) = 0; + virtual void load(uint64_t & t) = 0; #endif virtual void load(float & t) = 0; @@ -161,10 +161,10 @@ public: // special esteem in the boost library - we included it here by default. #include -namespace boost { +namespace boost { namespace archive { -class polymorphic_iarchive : +class polymorphic_iarchive : public polymorphic_iarchive_impl, public detail::shared_ptr_helper { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp index 420029b5..183140ee 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/archive/polymorphic_oarchive.hpp @@ -17,7 +17,7 @@ // See http://www.boost.org for updates, documentation, and revision history. #include // size_t -#include // ULONG_MAX +#include // ULONG_MAX #include #include @@ -82,8 +82,8 @@ public: virtual void save(const boost::long_long_type t) = 0; virtual void save(const boost::ulong_long_type t) = 0; #elif defined(BOOST_HAS_MS_INT64) - virtual void save(const __int64 t) = 0; - virtual void save(const unsigned __int64 t) = 0; + virtual void save(const int64_t t) = 0; + virtual void save(const uint64_t t) = 0; #endif virtual void save(const float t) = 0; @@ -141,7 +141,7 @@ public: }; // note: preserve naming symmetry -class polymorphic_oarchive : +class polymorphic_oarchive : public polymorphic_oarchive_impl { public: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/old_win_sdk_compat.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/old_win_sdk_compat.hpp index fcc27cf2..5db437d8 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/old_win_sdk_compat.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/asio/detail/old_win_sdk_compat.hpp @@ -41,7 +41,7 @@ namespace detail { enum { sockaddr_storage_maxsize = 128, // Maximum size. - sockaddr_storage_alignsize = (sizeof(__int64)), // Desired alignment. + sockaddr_storage_alignsize = (sizeof(int64_t)), // Desired alignment. sockaddr_storage_pad1size = (sockaddr_storage_alignsize - sizeof(short)), sockaddr_storage_pad2size = (sockaddr_storage_maxsize - (sizeof(short) + sockaddr_storage_pad1size + sockaddr_storage_alignsize)) @@ -51,7 +51,7 @@ struct sockaddr_storage_emulation { short ss_family; char __ss_pad1[sockaddr_storage_pad1size]; - __int64 __ss_align; + int64_t __ss_align; char __ss_pad2[sockaddr_storage_pad2size]; }; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/atomic/detail/interlocked.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/atomic/detail/interlocked.hpp index 84a71316..86bd03f0 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/atomic/detail/interlocked.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/atomic/detail/interlocked.hpp @@ -94,12 +94,12 @@ #pragma intrinsic(_InterlockedOr64) #pragma intrinsic(_InterlockedXor64) -#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((__int64*)(dest), (__int64)(newval)) -#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((__int64*)(dest), (__int64)(arg)) -#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((__int64*)(dest), (__int64)(arg)) -#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((__int64*)(dest), (__int64)(arg)) +#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) _InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) _InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) _InterlockedExchange64((int64_t*)(dest), (int64_t)(newval)) +#define BOOST_ATOMIC_INTERLOCKED_AND64(dest, arg) _InterlockedAnd64((int64_t*)(dest), (int64_t)(arg)) +#define BOOST_ATOMIC_INTERLOCKED_OR64(dest, arg) _InterlockedOr64((int64_t*)(dest), (int64_t)(arg)) +#define BOOST_ATOMIC_INTERLOCKED_XOR64(dest, arg) _InterlockedXor64((int64_t*)(dest), (int64_t)(arg)) #pragma intrinsic(_InterlockedCompareExchangePointer) #pragma intrinsic(_InterlockedExchangePointer) @@ -128,9 +128,9 @@ #if defined(_WIN64) -#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) InterlockedExchange64((__int64*)(dest), (__int64)(newval)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend)) +#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) InterlockedExchange64((int64_t*)(dest), (int64_t)(newval)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend)) #define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare)) #define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) InterlockedExchangePointer((void**)(dest), (void*)(newval)) @@ -168,16 +168,16 @@ BOOST_ATOMIC_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd(long volat #if defined(_WIN64) -BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedCompareExchange64(__int64 volatile*, __int64, __int64); -BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchange64(__int64 volatile*, __int64); -BOOST_ATOMIC_INTERLOCKED_IMPORT __int64 __stdcall InterlockedExchangeAdd64(__int64 volatile*, __int64); +BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedCompareExchange64(int64_t volatile*, int64_t, int64_t); +BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedExchange64(int64_t volatile*, int64_t); +BOOST_ATOMIC_INTERLOCKED_IMPORT int64_t __stdcall InterlockedExchangeAdd64(int64_t volatile*, int64_t); BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer(void* volatile *, void*, void*); BOOST_ATOMIC_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer(void* volatile *, void*); -#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange64((__int64*)(dest), (__int64)(exchange), (__int64)(compare)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) boost::atomics::detail::InterlockedExchange64((__int64*)(dest), (__int64)(newval)) -#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) boost::atomics::detail::InterlockedExchangeAdd64((__int64*)(dest), (__int64)(addend)) +#define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE64(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchange64((int64_t*)(dest), (int64_t)(exchange), (int64_t)(compare)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE64(dest, newval) boost::atomics::detail::InterlockedExchange64((int64_t*)(dest), (int64_t)(newval)) +#define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_ADD64(dest, addend) boost::atomics::detail::InterlockedExchangeAdd64((int64_t*)(dest), (int64_t)(addend)) #define BOOST_ATOMIC_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest, exchange, compare) boost::atomics::detail::InterlockedCompareExchangePointer((void**)(dest), (void*)(exchange), (void*)(compare)) #define BOOST_ATOMIC_INTERLOCKED_EXCHANGE_POINTER(dest, newval) boost::atomics::detail::InterlockedExchangePointer((void**)(dest), (void*)(newval)) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/chrono/detail/inlined/win/chrono.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/chrono/detail/inlined/win/chrono.hpp index 17dae964..213fc1fb 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/chrono/detail/inlined/win/chrono.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/chrono/detail/inlined/win/chrono.hpp @@ -100,7 +100,7 @@ namespace chrono_detail #endif return system_clock::time_point( system_clock::duration( - ((static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime) + ((static_cast( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime) -116444736000000000LL ) ); @@ -124,14 +124,14 @@ namespace chrono_detail ec.clear(); } return time_point(duration( - (static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)); + (static_cast( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime)); } #endif BOOST_CHRONO_INLINE std::time_t system_clock::to_time_t(const system_clock::time_point& t) BOOST_NOEXCEPT { - __int64 temp = t.time_since_epoch().count(); + int64_t temp = t.time_since_epoch().count(); temp /= 10000000; return static_cast( temp ); @@ -140,7 +140,7 @@ namespace chrono_detail BOOST_CHRONO_INLINE system_clock::time_point system_clock::from_time_t(std::time_t t) BOOST_NOEXCEPT { - __int64 temp = t; + int64_t temp = t; temp *= 10000000; return time_point(duration(temp)); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/concept_check.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/concept_check.hpp index bf5a2af7..09e5e789 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/concept_check.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/concept_check.hpp @@ -85,8 +85,8 @@ namespace boost template <> struct Integer< ::boost::long_long_type> {}; template <> struct Integer< ::boost::ulong_long_type> {}; # elif defined(BOOST_HAS_MS_INT64) - template <> struct Integer<__int64> {}; - template <> struct Integer {}; + template <> struct Integer {}; + template <> struct Integer {}; # endif BOOST_concept(SignedInteger,(T)) { @@ -103,7 +103,7 @@ namespace boost # if defined(BOOST_HAS_LONG_LONG) template <> struct SignedInteger< ::boost::long_long_type> {}; # elif defined(BOOST_HAS_MS_INT64) - template <> struct SignedInteger<__int64> {}; + template <> struct SignedInteger {}; # endif BOOST_concept(UnsignedInteger,(T)) { @@ -121,7 +121,7 @@ namespace boost # if defined(BOOST_HAS_LONG_LONG) template <> struct UnsignedInteger< ::boost::ulong_long_type> {}; # elif defined(BOOST_HAS_MS_INT64) - template <> struct UnsignedInteger {}; + template <> struct UnsignedInteger {}; # endif //=========================================================================== diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/borland.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/borland.hpp index cffa8ea0..c00dbfd2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/borland.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/borland.hpp @@ -155,7 +155,7 @@ # define BOOST_NO_CXX11_DECLTYPE # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_EXTERN_TEMPLATE -# define BOOST_NO_CXX11_RVALUE_REFERENCES +# define BOOST_NO_CXX11_RVALUE_REFERENCES # define BOOST_NO_CXX11_SCOPED_ENUMS # define BOOST_NO_CXX11_STATIC_ASSERT #else @@ -221,7 +221,7 @@ #include #endif // -// __int64: +// int64_t: // #if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__) # define BOOST_HAS_MS_INT64 @@ -242,7 +242,7 @@ // all versions support __declspec: // #if defined(__STRICT_ANSI__) -// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined +// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined # define BOOST_SYMBOL_EXPORT #endif // diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/clang.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/clang.hpp index 18d6e546..d06b7f67 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/clang.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/clang.hpp @@ -1,7 +1,7 @@ // (C) Copyright Douglas Gregor 2010 // -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -20,7 +20,7 @@ # define BOOST_NO_TYPEID #endif -#if defined(__int64) +#if defined(int64_t) # define BOOST_HAS_MS_INT64 #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/codegear.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/codegear.hpp index 1a6df335..7fc6f2f3 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/codegear.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/codegear.hpp @@ -129,7 +129,7 @@ #endif // -// __int64: +// int64_t: // #if !defined(__STRICT_ANSI__) # define BOOST_HAS_MS_INT64 @@ -150,7 +150,7 @@ // all versions support __declspec: // #if defined(__STRICT_ANSI__) -// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined +// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined # define BOOST_SYMBOL_EXPORT #endif // diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/comeau.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/comeau.hpp index 278222dc..7c4ac026 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/comeau.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/comeau.hpp @@ -1,11 +1,11 @@ -// (C) Copyright John Maddock 2001. -// (C) Copyright Douglas Gregor 2001. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright Aleksey Gurtovoy 2003. -// (C) Copyright Beman Dawes 2003. -// (C) Copyright Jens Maurer 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001. +// (C) Copyright Douglas Gregor 2001. +// (C) Copyright Peter Dimov 2001. +// (C) Copyright Aleksey Gurtovoy 2003. +// (C) Copyright Beman Dawes 2003. +// (C) Copyright Jens Maurer 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -32,7 +32,7 @@ #endif // version 4245 // -// enable __int64 support in VC emulation mode +// enable int64_t support in VC emulation mode // # if defined(_MSC_VER) && (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/visualc.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/visualc.hpp index aa4584df..2864fb25 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/visualc.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/compiler/visualc.hpp @@ -1,11 +1,11 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Darin Adler 2001 - 2002. -// (C) Copyright Peter Dimov 2001. -// (C) Copyright Aleksey Gurtovoy 2002. -// (C) Copyright David Abrahams 2002 - 2003. -// (C) Copyright Beman Dawes 2002 - 2003. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Darin Adler 2001 - 2002. +// (C) Copyright Peter Dimov 2001. +// (C) Copyright Aleksey Gurtovoy 2002. +// (C) Copyright David Abrahams 2002 - 2003. +// (C) Copyright Beman Dawes 2002 - 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. @@ -94,7 +94,7 @@ #endif -#if _MSC_VER < 1400 +#if _MSC_VER < 1400 // although a conforming signature for swprint exists in VC7.1 // it appears not to actually work: # define BOOST_NO_SWPRINTF @@ -119,9 +119,9 @@ #endif -// MSVC (including the latest checked version) has not yet completely +// MSVC (including the latest checked version) has not yet completely // implemented value-initialization, as is reported: -// "VC++ does not value-initialize members of derived classes without +// "VC++ does not value-initialize members of derived classes without // user-declared constructor", reported in 2009 by Sylvester Hesp: // https://connect.microsoft.com/VisualStudio/feedback/details/484295 // "Presence of copy constructor breaks member class initialization", @@ -152,14 +152,14 @@ # define BOOST_HAS_GETSYSTEMTIMEASFILETIME #endif -// -// check for exception handling support: +// +// check for exception handling support: #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS) -# define BOOST_NO_EXCEPTIONS -#endif +# define BOOST_NO_EXCEPTIONS +#endif // -// __int64 support: +// int64_t support: // #if (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 @@ -251,7 +251,7 @@ #ifndef BOOST_COMPILER // TODO: -// these things are mostly bogus. 1200 means version 12.0 of the compiler. The +// these things are mostly bogus. 1200 means version 12.0 of the compiler. The // artificial versions assigned to them only refer to the versions of some IDE // these compilers have been shipped with, and even that is not all of it. Some // were shipped with freely downloadable SDKs, others as crosscompilers in eVC. @@ -274,8 +274,8 @@ # define BOOST_COMPILER_VERSION evc9 # elif _MSC_VER < 1700 # define BOOST_COMPILER_VERSION evc10 -# elif _MSC_VER < 1800 -# define BOOST_COMPILER_VERSION evc11 +# elif _MSC_VER < 1800 +# define BOOST_COMPILER_VERSION evc11 # else # if defined(BOOST_ASSERT_CONFIG) # error "Unknown EVC++ compiler version - please run the configure tests and report the results" @@ -299,8 +299,8 @@ # define BOOST_COMPILER_VERSION 9.0 # elif _MSC_VER < 1700 # define BOOST_COMPILER_VERSION 10.0 -# elif _MSC_VER < 1800 -# define BOOST_COMPILER_VERSION 11.0 +# elif _MSC_VER < 1800 +# define BOOST_COMPILER_VERSION 11.0 # else # define BOOST_COMPILER_VERSION _MSC_VER # endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/stdlib/roguewave.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/stdlib/roguewave.hpp index cb80f570..66d8358e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/stdlib/roguewave.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/stdlib/roguewave.hpp @@ -1,16 +1,16 @@ -// (C) Copyright John Maddock 2001 - 2003. -// (C) Copyright Jens Maurer 2001. -// (C) Copyright David Abrahams 2003. -// (C) Copyright Boris Gubenko 2007. -// Use, modification and distribution are subject to the -// Boost Software License, Version 1.0. (See accompanying file +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Jens Maurer 2001. +// (C) Copyright David Abrahams 2003. +// (C) Copyright Boris Gubenko 2007. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for most recent version. // Rogue Wave std lib: -#define BOOST_RW_STDLIB 1 +#define BOOST_RW_STDLIB 1 #if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) # include @@ -57,7 +57,7 @@ # endif // -// Borland version of numeric_limits lacks __int64 specialisation: +// Borland version of numeric_limits lacks int64_t specialisation: // #ifdef __BORLANDC__ # define BOOST_NO_MS_INT64_NUMERIC_LIMITS diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/suffix.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/suffix.hpp index 8ee88d90..5d1484a1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/suffix.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/config/suffix.hpp @@ -4,7 +4,7 @@ // Copyright (c) 2001-2003 John Maddock // Copyright (c) 2001 Darin Adler // Copyright (c) 2001 Peter Dimov -// Copyright (c) 2002 Bill Kempf +// Copyright (c) 2002 Bill Kempf // Copyright (c) 2002 Jens Maurer // Copyright (c) 2002-2003 David Abrahams // Copyright (c) 2003 Gennaro Prota @@ -105,8 +105,8 @@ #endif // -// if there is no __int64 then there is no specialisation -// for numeric_limits<__int64> either: +// if there is no int64_t then there is no specialisation +// for numeric_limits either: // #if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS) # define BOOST_NO_MS_INT64_NUMERIC_LIMITS @@ -146,7 +146,7 @@ # endif // -// Without partial specialization, partial +// Without partial specialization, partial // specialization with default args won't work either: // # if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ @@ -632,7 +632,7 @@ namespace std{ using ::type_info; } // Set some default values GPU support // # ifndef BOOST_GPU_ENABLED -# define BOOST_GPU_ENABLED +# define BOOST_GPU_ENABLED # endif // BOOST_FORCEINLINE ---------------------------------------------// @@ -695,7 +695,7 @@ namespace std{ using ::type_info; } # define BOOST_NO_0X_HDR_FUTURE #endif -// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST +// Use BOOST_NO_CXX11_HDR_INITIALIZER_LIST // instead of BOOST_NO_0X_HDR_INITIALIZER_LIST or BOOST_NO_INITIALIZER_LISTS #ifdef BOOST_NO_CXX11_HDR_INITIALIZER_LIST # ifndef BOOST_NO_0X_HDR_INITIALIZER_LIST @@ -884,7 +884,7 @@ namespace std{ using ::type_info; } // // constexpr workarounds -// +// #if defined(BOOST_NO_CXX11_CONSTEXPR) #define BOOST_CONSTEXPR #define BOOST_CONSTEXPR_OR_CONST const diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/cstdint.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/cstdint.hpp index ea84b650..c53bdc9f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/cstdint.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/cstdint.hpp @@ -1,8 +1,8 @@ // boost cstdint.hpp header file ------------------------------------------// -// (C) Copyright Beman Dawes 1999. -// (C) Copyright Jens Mauer 2001 -// (C) Copyright John Maddock 2001 +// (C) Copyright Beman Dawes 1999. +// (C) Copyright Jens Mauer 2001 +// (C) Copyright John Maddock 2001 // Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -24,9 +24,9 @@ #define BOOST_CSTDINT_HPP // -// Since we always define the INT#_C macros as per C++0x, +// Since we always define the INT#_C macros as per C++0x, // define __STDC_CONSTANT_MACROS so that does the right -// thing if possible, and so that the user knows that the macros +// thing if possible, and so that the user knows that the macros // are actually defined as per C99. // #ifndef __STDC_CONSTANT_MACROS @@ -50,7 +50,7 @@ # ifdef __STDC_32_MODE__ // this is triggered with GCC, because it defines __cplusplus < 199707L # define BOOST_NO_INT64_T -# endif +# endif # elif defined(__FreeBSD__) || defined(__IBMCPP__) || defined(_AIX) # include # else @@ -100,40 +100,40 @@ typedef ::uintfast64_t uint_fast64_t; namespace boost { - using ::int8_t; - using ::int_least8_t; - using ::int_fast8_t; - using ::uint8_t; - using ::uint_least8_t; - using ::uint_fast8_t; - - using ::int16_t; - using ::int_least16_t; - using ::int_fast16_t; - using ::uint16_t; - using ::uint_least16_t; - using ::uint_fast16_t; - - using ::int32_t; - using ::int_least32_t; - using ::int_fast32_t; - using ::uint32_t; - using ::uint_least32_t; - using ::uint_fast32_t; - + using ::int8_t; + using ::int_least8_t; + using ::int_fast8_t; + using ::uint8_t; + using ::uint_least8_t; + using ::uint_fast8_t; + + using ::int16_t; + using ::int_least16_t; + using ::int_fast16_t; + using ::uint16_t; + using ::uint_least16_t; + using ::uint_fast16_t; + + using ::int32_t; + using ::int_least32_t; + using ::int_fast32_t; + using ::uint32_t; + using ::uint_least32_t; + using ::uint_fast32_t; + # ifndef BOOST_NO_INT64_T - using ::int64_t; - using ::int_least64_t; - using ::int_fast64_t; - using ::uint64_t; - using ::uint_least64_t; - using ::uint_fast64_t; - + using ::int64_t; + using ::int_least64_t; + using ::int_fast64_t; + using ::uint64_t; + using ::uint_least64_t; + using ::uint_fast64_t; + # endif - using ::intmax_t; - using ::uintmax_t; + using ::intmax_t; + using ::uintmax_t; } // namespace boost @@ -143,35 +143,35 @@ namespace boost namespace boost { - using ::int8_t; - typedef int8_t int_least8_t; - typedef int8_t int_fast8_t; - using ::uint8_t; - typedef uint8_t uint_least8_t; - typedef uint8_t uint_fast8_t; - - using ::int16_t; - typedef int16_t int_least16_t; - typedef int16_t int_fast16_t; - using ::uint16_t; - typedef uint16_t uint_least16_t; - typedef uint16_t uint_fast16_t; - - using ::int32_t; - typedef int32_t int_least32_t; - typedef int32_t int_fast32_t; - using ::uint32_t; - typedef uint32_t uint_least32_t; - typedef uint32_t uint_fast32_t; - -# ifndef BOOST_NO_INT64_T + using ::int8_t; + typedef int8_t int_least8_t; + typedef int8_t int_fast8_t; + using ::uint8_t; + typedef uint8_t uint_least8_t; + typedef uint8_t uint_fast8_t; - using ::int64_t; - typedef int64_t int_least64_t; - typedef int64_t int_fast64_t; - using ::uint64_t; - typedef uint64_t uint_least64_t; - typedef uint64_t uint_fast64_t; + using ::int16_t; + typedef int16_t int_least16_t; + typedef int16_t int_fast16_t; + using ::uint16_t; + typedef uint16_t uint_least16_t; + typedef uint16_t uint_fast16_t; + + using ::int32_t; + typedef int32_t int_least32_t; + typedef int32_t int_fast32_t; + using ::uint32_t; + typedef uint32_t uint_least32_t; + typedef uint32_t uint_fast32_t; + +# ifndef BOOST_NO_INT64_T + + using ::int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + using ::uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; typedef int64_t intmax_t; typedef uint64_t uintmax_t; @@ -235,15 +235,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif -# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) - // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified - // MTA / XMT does support the following non-standard integer types - typedef __short16 int16_t; - typedef __short16 int_least16_t; - typedef __short16 int_fast16_t; - typedef unsigned __short16 uint16_t; - typedef unsigned __short16 uint_least16_t; - typedef unsigned __short16 uint_fast16_t; +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -277,14 +277,14 @@ namespace boost typedef unsigned long uint32_t; typedef unsigned long uint_least32_t; typedef unsigned long uint_fast32_t; -# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) - // Integers are 64 bits on the MTA / XMT - typedef __int32 int32_t; - typedef __int32 int_least32_t; - typedef __int32 int_fast32_t; - typedef unsigned __int32 uint32_t; - typedef unsigned __int32 uint_least32_t; - typedef unsigned __int32 uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -337,16 +337,16 @@ namespace boost __extension__ typedef unsigned long long uint_fast64_t; # elif defined(BOOST_HAS_MS_INT64) // - // we have Borland/Intel/Microsoft __int64: + // we have Borland/Intel/Microsoft int64_t: // - typedef __int64 intmax_t; - typedef unsigned __int64 uintmax_t; - typedef __int64 int64_t; - typedef __int64 int_least64_t; - typedef __int64 int_fast64_t; - typedef unsigned __int64 uint64_t; - typedef unsigned __int64 uint_least64_t; - typedef unsigned __int64 uint_fast64_t; + typedef int64_t intmax_t; + typedef uint64_t uintmax_t; + typedef int64_t int64_t; + typedef int64_t int_least64_t; + typedef int64_t int_fast64_t; + typedef uint64_t uint64_t; + typedef uint64_t uint_least64_t; + typedef uint64_t uint_fast64_t; # else // assume no 64-bit integers # define BOOST_NO_INT64_T typedef int32_t intmax_t; @@ -376,15 +376,15 @@ INT#_C macros if they're not already defined (John Maddock). #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) // -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. +// For the following code we get several warnings along the lines of: // -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif #include # define BOOST__STDC_CONSTANT_MACROS_DEFINED diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/basic_types.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/basic_types.hpp index f4e34721..17411c3a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/basic_types.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/basic_types.hpp @@ -68,7 +68,7 @@ extern "C" { //~ #if defined(BOOST_NO_INT64_T) //~ typedef double LONGLONG_; //~ #else - //~ typedef __int64 LONGLONG_; + //~ typedef int64_t LONGLONG_; //~ #endif //~ #else //~ typedef double LONGLONG_; @@ -80,7 +80,7 @@ extern "C" { #if defined(__CYGWIN__) typedef unsigned long ULONG_PTR_; #else - typedef unsigned __int64 ULONG_PTR_; + typedef uint64_t ULONG_PTR_; #endif # else typedef unsigned long ULONG_PTR_; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/synchronization.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/synchronization.hpp index 8fe015b3..fbf15fd4 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/synchronization.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/detail/win/synchronization.hpp @@ -27,7 +27,7 @@ namespace win32 using ::TryEnterCriticalSection; using ::LeaveCriticalSection; using ::DeleteCriticalSection; - + # ifdef BOOST_NO_ANSI_APIS using ::CreateMutexW; using ::CreateEventW; @@ -56,67 +56,67 @@ extern "C" { void * OwningThread; void * LockSemaphore; #if defined(_WIN64) - unsigned __int64 SpinCount; + uint64_t SpinCount; #else unsigned long SpinCount; #endif }; - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall InitializeCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall EnterCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) bool __stdcall + __declspec(dllimport) bool __stdcall TryEnterCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall LeaveCriticalSection(CRITICAL_SECTION_ *); - __declspec(dllimport) void __stdcall + __declspec(dllimport) void __stdcall DeleteCriticalSection(CRITICAL_SECTION_ *); - + struct _SECURITY_ATTRIBUTES; # ifdef BOOST_NO_ANSI_APIS - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateMutexW(_SECURITY_ATTRIBUTES*,int,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateSemaphoreW(_SECURITY_ATTRIBUTES*,long,long,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateEventW(_SECURITY_ATTRIBUTES*,int,int,wchar_t const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall OpenEventW(unsigned long,int,wchar_t const*); # else - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateMutexA(_SECURITY_ATTRIBUTES*,int,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateSemaphoreA(_SECURITY_ATTRIBUTES*,long,long,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall CreateEventA(_SECURITY_ATTRIBUTES*,int,int,char const*); - __declspec(dllimport) void* __stdcall + __declspec(dllimport) void* __stdcall OpenEventA(unsigned long,int,char const*); # endif - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ReleaseMutex(void*); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall WaitForSingleObject(void*,unsigned long); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall WaitForMultipleObjects(unsigned long nCount, void* const * lpHandles, int bWaitAll, unsigned long dwMilliseconds); - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ReleaseSemaphore(void*,long,long*); typedef void (__stdcall *PAPCFUNC8)(ulong_ptr); - __declspec(dllimport) unsigned long __stdcall + __declspec(dllimport) unsigned long __stdcall QueueUserAPC(PAPCFUNC8,void*,ulong_ptr); # ifndef UNDER_CE - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall SetEvent(void*); - __declspec(dllimport) int __stdcall + __declspec(dllimport) int __stdcall ResetEvent(void*); # else using ::SetEvent; using ::ResetEvent; # endif -} +} #endif } } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer.hpp index 35a1e109..3eeb8f21 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer.hpp @@ -42,15 +42,15 @@ namespace boost // fast integers from least integers // int_fast_t<> works correctly for unsigned too, in spite of the name. template< typename LeastInt > - struct int_fast_t - { - typedef LeastInt fast; + struct int_fast_t + { + typedef LeastInt fast; typedef fast type; }; // imps may specialize namespace detail{ - // convert category to type + // convert category to type template< int Category > struct int_least_helper {}; // default is empty template< int Category > struct uint_least_helper {}; // default is empty @@ -60,7 +60,7 @@ namespace boost #ifdef BOOST_HAS_LONG_LONG template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) - template<> struct int_least_helper<1> { typedef __int64 least; }; + template<> struct int_least_helper<1> { typedef int64_t least; }; #endif template<> struct int_least_helper<2> { typedef long least; }; template<> struct int_least_helper<3> { typedef int least; }; @@ -69,7 +69,7 @@ namespace boost #ifdef BOOST_HAS_LONG_LONG template<> struct uint_least_helper<1> { typedef boost::ulong_long_type least; }; #elif defined(BOOST_HAS_MS_INT64) - template<> struct uint_least_helper<1> { typedef unsigned __int64 least; }; + template<> struct uint_least_helper<1> { typedef uint64_t least; }; #endif template<> struct uint_least_helper<2> { typedef unsigned long least; }; template<> struct uint_least_helper<3> { typedef unsigned int least; }; @@ -138,7 +138,7 @@ namespace boost "No suitable unsigned integer type with the requested number of bits is available."); #if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) // It's really not clear why this workaround should be needed... shrug I guess! JM - BOOST_STATIC_CONSTANT(int, s = + BOOST_STATIC_CONSTANT(int, s = 6 + (Bits <= ::std::numeric_limits::digits) + (Bits <= ::std::numeric_limits::digits) + @@ -147,7 +147,7 @@ namespace boost typedef typename detail::int_least_helper< ::boost::uint_t::s>::least least; #else typedef typename detail::uint_least_helper - < + < #ifdef BOOST_HAS_LONG_LONG (Bits <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + #else @@ -171,7 +171,7 @@ namespace boost #else template< long MaxValue > // maximum value to require support #endif - struct int_max_value_t + struct int_max_value_t { typedef typename detail::int_least_helper < @@ -193,7 +193,7 @@ namespace boost #else template< long MinValue > // minimum value to require support #endif - struct int_min_value_t + struct int_min_value_t { typedef typename detail::int_least_helper < @@ -216,12 +216,12 @@ namespace boost #else template< unsigned long MaxValue > // minimum value to require support #endif - struct uint_value_t + struct uint_value_t { #if (defined(__BORLANDC__) || defined(__CODEGEAR__)) // It's really not clear why this workaround should be needed... shrug I guess! JM #if defined(BOOST_NO_INTEGRAL_INT64_T) - BOOST_STATIC_CONSTANT(unsigned, which = + BOOST_STATIC_CONSTANT(unsigned, which = 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + @@ -229,7 +229,7 @@ namespace boost (MaxValue <= ::boost::integer_traits::const_max)); typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; #else // BOOST_NO_INTEGRAL_INT64_T - BOOST_STATIC_CONSTANT(unsigned, which = + BOOST_STATIC_CONSTANT(unsigned, which = 1 + (MaxValue <= ::boost::integer_traits::const_max) + (MaxValue <= ::boost::integer_traits::const_max) + @@ -240,7 +240,7 @@ namespace boost #endif // BOOST_NO_INTEGRAL_INT64_T #else typedef typename detail::uint_least_helper - < + < #if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) (MaxValue <= ::boost::integer_traits::const_max) + #else diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer/integer_mask.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer/integer_mask.hpp index 2acf7f7d..87237bab 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer/integer_mask.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer/integer_mask.hpp @@ -5,7 +5,7 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_INTEGER_INTEGER_MASK_HPP #define BOOST_INTEGER_INTEGER_MASK_HPP @@ -109,7 +109,7 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); #endif #elif defined(BOOST_HAS_MS_INT64) #if 18446744073709551615ui64 > ULONG_MAX - BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 ); + BOOST_LOW_BITS_MASK_SPECIALIZE( uint64_t ); #endif #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_fwd.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_fwd.hpp index 20eff2bc..59055602 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_fwd.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_fwd.hpp @@ -85,10 +85,10 @@ template < > class integer_traits< ::boost::ulong_long_type >; #elif !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_MS_INT64) template < > -class integer_traits<__int64>; +class integer_traits; template < > -class integer_traits; +class integer_traits; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_traits.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_traits.hpp index ddd56095..79ee3472 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_traits.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/integer_traits.hpp @@ -239,15 +239,15 @@ class integer_traits< ::boost::ulong_long_type> #elif defined(BOOST_HAS_MS_INT64) template<> -class integer_traits< __int64> - : public std::numeric_limits< __int64>, - public detail::integer_traits_base< __int64, _I64_MIN, _I64_MAX> +class integer_traits< int64_t> + : public std::numeric_limits< int64_t>, + public detail::integer_traits_base< int64_t, _I64_MIN, _I64_MAX> { }; template<> -class integer_traits< unsigned __int64> - : public std::numeric_limits< unsigned __int64>, - public detail::integer_traits_base< unsigned __int64, 0, _UI64_MAX> +class integer_traits< uint64_t> + : public std::numeric_limits< uint64_t>, + public detail::integer_traits_base< uint64_t, 0, _UI64_MAX> { }; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/detail/win32_api.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/detail/win32_api.hpp index 078eef10..dbacf1b5 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/detail/win32_api.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/detail/win32_api.hpp @@ -610,7 +610,7 @@ struct interprocess_section_basic_information { void * base_address; unsigned long section_attributes; - __int64 section_size; + int64_t section_size; }; struct interprocess_filetime @@ -778,9 +778,9 @@ union system_timeofday_information { struct data_t { - __int64 liKeBootTime; - __int64 liKeSystemTime; - __int64 liExpTimeZoneBias; + int64_t liKeBootTime; + int64_t liKeSystemTime; + int64_t liExpTimeZoneBias; unsigned long uCurrentTimeZoneId; unsigned long dwReserved; } data; @@ -877,7 +877,7 @@ extern "C" __declspec(dllimport) int __stdcall FlushViewOfFile (void *, std::siz extern "C" __declspec(dllimport) int __stdcall VirtualUnlock (void *, std::size_t); extern "C" __declspec(dllimport) int __stdcall VirtualProtect (void *, std::size_t, unsigned long, unsigned long *); extern "C" __declspec(dllimport) int __stdcall FlushFileBuffers (void *); -extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, __int64 *size); +extern "C" __declspec(dllimport) int __stdcall GetFileSizeEx (void *, int64_t *size); extern "C" __declspec(dllimport) unsigned long __stdcall FormatMessageA (unsigned long dwFlags, const void *lpSource, unsigned long dwMessageId, unsigned long dwLanguageId, char *lpBuffer, unsigned long nSize, @@ -888,9 +888,9 @@ extern "C" __declspec(dllimport) int __stdcall CreateDirectoryA(const char *, in extern "C" __declspec(dllimport) int __stdcall RemoveDirectoryA(const char *lpPathName); extern "C" __declspec(dllimport) int __stdcall GetTempPathA(unsigned long length, char *buffer); extern "C" __declspec(dllimport) int __stdcall CreateDirectory(const char *, interprocess_security_attributes*); -extern "C" __declspec(dllimport) int __stdcall SetFileValidData(void *, __int64 size); +extern "C" __declspec(dllimport) int __stdcall SetFileValidData(void *, int64_t size); extern "C" __declspec(dllimport) int __stdcall SetEndOfFile(void *); -extern "C" __declspec(dllimport) int __stdcall SetFilePointerEx(void *, __int64 distance, __int64 *new_file_pointer, unsigned long move_method); +extern "C" __declspec(dllimport) int __stdcall SetFilePointerEx(void *, int64_t distance, int64_t *new_file_pointer, unsigned long move_method); extern "C" __declspec(dllimport) int __stdcall LockFile (void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high); extern "C" __declspec(dllimport) int __stdcall UnlockFile(void *hnd, unsigned long offset_low, unsigned long offset_high, unsigned long size_low, unsigned long size_high); extern "C" __declspec(dllimport) int __stdcall LockFileEx(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped* overlapped); @@ -908,7 +908,7 @@ extern "C" __declspec(dllimport) unsigned long __stdcall GetMappedFileNameW(void extern "C" __declspec(dllimport) long __stdcall RegOpenKeyExA(void *, const char *, unsigned long, unsigned long, void **); extern "C" __declspec(dllimport) long __stdcall RegQueryValueExA(void *, const char *, unsigned long*, unsigned long*, unsigned char *, unsigned long*); extern "C" __declspec(dllimport) long __stdcall RegCloseKey(void *); -extern "C" __declspec(dllimport) int __stdcall QueryPerformanceCounter(__int64 *lpPerformanceCount); +extern "C" __declspec(dllimport) int __stdcall QueryPerformanceCounter(int64_t *lpPerformanceCount); //COM API extern "C" __declspec(dllimport) long __stdcall CoInitializeEx(void *pvReserved, unsigned long dwCoInit); @@ -1091,7 +1091,7 @@ class interprocess_all_access_security { return &sa; } }; -inline void * create_file_mapping (void * handle, unsigned long access, unsigned __int64 file_offset, const char * name, interprocess_security_attributes *psec) +inline void * create_file_mapping (void * handle, unsigned long access, uint64_t file_offset, const char * name, interprocess_security_attributes *psec) { const unsigned long high_size(file_offset >> 32), low_size((boost::uint32_t)file_offset); return CreateFileMappingA (handle, psec, access, high_size, low_size, name); @@ -1100,9 +1100,9 @@ inline void * create_file_mapping (void * handle, unsigned long access, unsigned inline void * open_file_mapping (unsigned long access, const char *name) { return OpenFileMappingA (access, 0, name); } -inline void *map_view_of_file_ex(void *handle, unsigned long file_access, unsigned __int64 offset, std::size_t numbytes, void *base_addr) +inline void *map_view_of_file_ex(void *handle, unsigned long file_access, uint64_t offset, std::size_t numbytes, void *base_addr) { - const unsigned long offset_low = (unsigned long)(offset & ((unsigned __int64)0xFFFFFFFF)); + const unsigned long offset_low = (unsigned long)(offset & ((uint64_t)0xFFFFFFFF)); const unsigned long offset_high = offset >> 32; return MapViewOfFileEx(handle, file_access, offset_high, offset_low, numbytes, base_addr); } @@ -1146,7 +1146,7 @@ inline bool virtual_protect(void *base_addr, std::size_t numbytes, unsigned long inline bool flush_file_buffers(void *handle) { return 0 != FlushFileBuffers(handle); } -inline bool get_file_size(void *handle, __int64 &size) +inline bool get_file_size(void *handle, int64_t &size) { return 0 != GetFileSizeEx(handle, &size); } inline bool create_directory(const char *name) @@ -1164,7 +1164,7 @@ inline unsigned long get_temp_path(unsigned long length, char *buffer) inline int set_end_of_file(void *handle) { return 0 != SetEndOfFile(handle); } -inline bool set_file_pointer_ex(void *handle, __int64 distance, __int64 *new_file_pointer, unsigned long move_method) +inline bool set_file_pointer_ex(void *handle, int64_t distance, int64_t *new_file_pointer, unsigned long move_method) { return 0 != SetFilePointerEx(handle, distance, new_file_pointer, move_method); } inline bool lock_file_ex(void *hnd, unsigned long flags, unsigned long reserved, unsigned long size_low, unsigned long size_high, interprocess_overlapped *overlapped) @@ -1225,7 +1225,7 @@ inline long reg_query_value_ex(void *hKey, const char *lpValueName, unsigned lon inline long reg_close_key(void *hKey) { return RegCloseKey(hKey); } -inline bool query_performance_counter(__int64 *lpPerformanceCount) +inline bool query_performance_counter(int64_t *lpPerformanceCount) { return 0 != QueryPerformanceCounter(lpPerformanceCount); } @@ -1812,7 +1812,7 @@ inline bool is_directory(const char *path) (attrib & file_attribute_directory)); } -inline bool get_file_mapping_size(void *file_mapping_hnd, __int64 &size) +inline bool get_file_mapping_size(void *file_mapping_hnd, int64_t &size) { NtQuerySection_t pNtQuerySection = (NtQuerySection_t)dll_func::get(dll_func::NtQuerySection); diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_condition_any.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_condition_any.hpp index 0d3b915b..6544948a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_condition_any.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_condition_any.hpp @@ -138,7 +138,7 @@ class windows_named_condition_any class named_cond_callbacks : public windows_named_sync_interface { - typedef __int64 sem_count_t; + typedef int64_t sem_count_t; mutable sem_count_t sem_counts [2]; public: diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_semaphore.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_semaphore.hpp index 8f48d4df..d53c6590 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_semaphore.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_semaphore.hpp @@ -66,7 +66,7 @@ class windows_named_semaphore class named_sem_callbacks : public windows_named_sync_interface { public: - typedef __int64 sem_count_t; + typedef int64_t sem_count_t; named_sem_callbacks(winapi_semaphore_wrapper &sem_wrapper, sem_count_t sem_cnt) : m_sem_wrapper(sem_wrapper), m_sem_count(sem_cnt) {} diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_sync.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_sync.hpp index 41f299f8..5f68674d 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_sync.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/named_sync.hpp @@ -122,12 +122,12 @@ inline void windows_named_sync::open_or_create if(m_file_hnd != winapi::invalid_handle_value){ //Now lock the file const std::size_t buflen = sync_interface.get_data_size(); - typedef __int64 unique_id_type; + typedef int64_t unique_id_type; const std::size_t sizeof_file_info = sizeof(unique_id_type) + buflen; winapi::interprocess_overlapped overlapped; if(winapi::lock_file_ex (m_file_hnd, winapi::lockfile_exclusive_lock, 0, sizeof_file_info, 0, &overlapped)){ - __int64 filesize = 0; + int64_t filesize = 0; //Obtain the unique id to open the native semaphore. //If file size was created if(winapi::get_file_size(m_file_hnd, filesize)){ diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/sync_utils.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/sync_utils.hpp index 92d8e55a..48ee516f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/sync_utils.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/interprocess/sync/windows/sync_utils.hpp @@ -62,7 +62,7 @@ inline bool bytes_to_str(const void *mem, const std::size_t mem_length, char *ou class sync_id { public: - typedef __int64 internal_type; + typedef int64_t internal_type; sync_id(const void *map_addr) : map_addr_(map_addr) { winapi::query_performance_counter(&rand_); } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/detail/config/rtl.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/detail/config/rtl.hpp index d9fbe508..7195a4a2 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/detail/config/rtl.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/iostreams/detail/config/rtl.hpp @@ -1,16 +1,16 @@ /* - * Distributed under the Boost Software License, Version 1.0.(See accompanying + * Distributed under the Boost Software License, Version 1.0.(See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) - * + * * See http://www.boost.org/libs/iostreams for documentation. * - * Defines preprocessor symbols expanding to the names of functions in the + * Defines preprocessor symbols expanding to the names of functions in the * C runtime library used to access file descriptors and to the type used * to store file offsets for seeking. - * + * * File: boost/iostreams/detail/config/rtl.hpp * Date: Wed Dec 26 11:58:11 MST 2007 - * + * * Copyright: 2007-2008 CodeRage, LLC * Author: Jonathan Turkanis * Contact: turkanis at coderage dot com @@ -39,9 +39,9 @@ #ifdef BOOST_IOSTREAMS_WINDOWS # if defined(BOOST_MSVC) || defined(__MSVCRT__) // MSVC, MinGW # define BOOST_IOSTREAMS_FD_SEEK _lseeki64 -# define BOOST_IOSTREAMS_FD_OFFSET __int64 +# define BOOST_IOSTREAMS_FD_OFFSET int64_t # else // Borland, Metrowerks, ... -# define BOOST_IOSTREAMS_FD_SEEK lseek +# define BOOST_IOSTREAMS_FD_SEEK lseek # define BOOST_IOSTREAMS_FD_OFFSET long # endif #else // Non-windows diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/lexical_cast.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/lexical_cast.hpp index 94dbaf97..2b0dfaca 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/lexical_cast.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/lexical_cast.hpp @@ -73,12 +73,12 @@ namespace boost { // exception used to indicate runtime lexical_cast failure class BOOST_SYMBOL_VISIBLE bad_lexical_cast : - // workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0 -#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS - public std::exception -#else - public std::bad_cast -#endif + // workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0 +#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS + public std::exception +#else + public std::bad_cast +#endif #if defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x560 ) // under bcc32 5.5.1 bad_cast doesn't derive from exception @@ -203,7 +203,7 @@ namespace boost { { // Converts signed/unsigned char to char template < class Char > - struct normalize_single_byte_char + struct normalize_single_byte_char { typedef Char type; }; @@ -223,7 +223,7 @@ namespace boost { namespace detail // deduce_character_type_later { - // Helper type, meaning that stram character for T must be deduced + // Helper type, meaning that stram character for T must be deduced // at Stage 2 (See deduce_source_char and deduce_target_char) template < class T > struct deduce_character_type_later {}; } @@ -260,7 +260,7 @@ namespace boost { Char, boost::detail::deduce_character_type_later< boost::iterator_range< Char* > > > {}; - + template < typename Char > struct stream_char_common< boost::iterator_range< const Char* > >: public boost::mpl::if_c< boost::detail::is_char_or_wchar< Char >::value, @@ -326,19 +326,19 @@ namespace boost { // Otherwise supplied type T is a character type, that must be normalized // using normalize_single_byte_char. // Executed at Stage 2 (See deduce_source_char and deduce_target_char) - template < class Char > + template < class Char > struct deduce_source_char_impl - { - typedef BOOST_DEDUCED_TYPENAME boost::detail::normalize_single_byte_char< Char >::type type; + { + typedef BOOST_DEDUCED_TYPENAME boost::detail::normalize_single_byte_char< Char >::type type; }; - - template < class T > - struct deduce_source_char_impl< deduce_character_type_later< T > > + + template < class T > + struct deduce_source_char_impl< deduce_character_type_later< T > > { typedef boost::has_left_shift< std::basic_ostream< char >, T > result_t; #if defined(BOOST_LCAST_NO_WCHAR_T) - BOOST_STATIC_ASSERT_MSG((result_t::value), + BOOST_STATIC_ASSERT_MSG((result_t::value), "Source type is not std::ostream`able and std::wostream`s are not supported by your STL implementation"); typedef char type; #else @@ -346,7 +346,7 @@ namespace boost { result_t::value, char, wchar_t >::type type; - BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_left_shift< std::basic_ostream< type >, T >::value), + BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_left_shift< std::basic_ostream< type >, T >::value), "Source type is neither std::ostream`able nor std::wostream`able"); #endif }; @@ -359,47 +359,47 @@ namespace boost { // Otherwise supplied type T is a character type, that must be normalized // using normalize_single_byte_char. // Executed at Stage 2 (See deduce_source_char and deduce_target_char) - template < class Char > - struct deduce_target_char_impl - { - typedef BOOST_DEDUCED_TYPENAME normalize_single_byte_char< Char >::type type; + template < class Char > + struct deduce_target_char_impl + { + typedef BOOST_DEDUCED_TYPENAME normalize_single_byte_char< Char >::type type; }; - - template < class T > - struct deduce_target_char_impl< deduce_character_type_later > - { + + template < class T > + struct deduce_target_char_impl< deduce_character_type_later > + { typedef boost::has_right_shift, T > result_t; #if defined(BOOST_LCAST_NO_WCHAR_T) - BOOST_STATIC_ASSERT_MSG((result_t::value), + BOOST_STATIC_ASSERT_MSG((result_t::value), "Target type is not std::istream`able and std::wistream`s are not supported by your STL implementation"); typedef char type; #else typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c< result_t::value, char, wchar_t >::type type; - - BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_right_shift, T >::value), + + BOOST_STATIC_ASSERT_MSG((result_t::value || boost::has_right_shift, T >::value), "Target type is neither std::istream`able nor std::wistream`able"); #endif }; - } + } namespace detail // deduce_target_char and deduce_source_char { // We deduce stream character types in two stages. // - // Stage 1 is common for Target and Source. At Stage 1 we get + // Stage 1 is common for Target and Source. At Stage 1 we get // non normalized character type (may contain unsigned/signed char) // or deduce_character_type_later where T is the original type. // Stage 1 is executed by stream_char_common // - // At Stage 2 we normalize character types or try to deduce character - // type using metafunctions. - // Stage 2 is executed by deduce_target_char_impl and + // At Stage 2 we normalize character types or try to deduce character + // type using metafunctions. + // Stage 2 is executed by deduce_target_char_impl and // deduce_source_char_impl // - // deduce_target_char and deduce_source_char functions combine + // deduce_target_char and deduce_source_char functions combine // both stages template < class T > @@ -521,11 +521,11 @@ namespace boost { namespace detail // is_this_float_conversion_optimized { - // this metafunction evaluates to true, if we have optimized comnversion - // from Float type to Char array. + // this metafunction evaluates to true, if we have optimized comnversion + // from Float type to Char array. // Must be in sync with lexical_stream_limited_src::shl_real_type(...) template - struct is_this_float_conversion_optimized + struct is_this_float_conversion_optimized { typedef boost::type_traits::ice_and< boost::is_float::value, @@ -542,7 +542,7 @@ namespace boost { BOOST_STATIC_CONSTANT(bool, value = (result_type::value) ); }; } - + namespace detail // lcast_src_length { // Return max. length of string representation of Source; @@ -599,8 +599,8 @@ namespace boost { BOOST_LCAST_DEF(boost::ulong_long_type) BOOST_LCAST_DEF(boost::long_long_type ) #elif defined(BOOST_HAS_MS_INT64) - BOOST_LCAST_DEF(unsigned __int64) - BOOST_LCAST_DEF( __int64) + BOOST_LCAST_DEF(uint64_t) + BOOST_LCAST_DEF( int64_t) #endif #undef BOOST_LCAST_DEF @@ -610,7 +610,7 @@ namespace boost { // -1.23456789e-123456 // ^ sign // ^ leading digit - // ^ decimal point + // ^ decimal point // ^^^^^^^^ lcast_precision::value // ^ "e" // ^ exponent sign @@ -658,11 +658,11 @@ namespace boost { struct lexical_cast_stream_traits { typedef BOOST_DEDUCED_TYPENAME boost::detail::array_to_pointer_decay::type src; typedef BOOST_DEDUCED_TYPENAME boost::remove_cv::type no_cv_src; - + typedef boost::detail::deduce_source_char deduce_src_char_metafunc; typedef BOOST_DEDUCED_TYPENAME deduce_src_char_metafunc::type src_char_t; typedef BOOST_DEDUCED_TYPENAME boost::detail::deduce_target_char::type target_char_t; - + typedef BOOST_DEDUCED_TYPENAME boost::detail::widest_char< target_char_t, src_char_t >::type char_type; @@ -700,12 +700,12 @@ namespace boost { // If we have an optimized conversion for // Source, we do not need to construct stringbuf. - BOOST_STATIC_CONSTANT(bool, requires_stringbuf = + BOOST_STATIC_CONSTANT(bool, requires_stringbuf = (boost::type_traits::ice_or< is_string_widening_required_t::value, is_source_input_not_optimized_t::value >::value) ); - + typedef boost::detail::lcast_src_length len_t; }; } @@ -1160,7 +1160,7 @@ namespace boost { #if defined(BOOST_HAS_LONG_LONG) typedef boost::ulong_long_type type; #elif defined(BOOST_HAS_MS_INT64) - typedef unsigned __int64 type; + typedef uint64_t type; #endif }; @@ -1494,7 +1494,7 @@ namespace boost { "Use boost::locale instead" ); return shl_input_streamable(str); } - + bool shl_char_array_limited(CharT const* str, std::size_t max_size) BOOST_NOEXCEPT { start = const_cast(str); @@ -1543,11 +1543,11 @@ namespace boost { { using namespace std; if (put_inf_nan(begin, end, val)) return true; const double val_as_double = val; - end = begin + + end = begin + #if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) sprintf_s(begin, end-begin, #else - sprintf(begin, + sprintf(begin, #endif "%.*g", static_cast(boost::detail::lcast_get_precision()), val_as_double); return end > begin; @@ -1556,11 +1556,11 @@ namespace boost { static bool shl_real_type(double val, char* begin, char*& end) { using namespace std; if (put_inf_nan(begin, end, val)) return true; - end = begin + + end = begin + #if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) sprintf_s(begin, end-begin, #else - sprintf(begin, + sprintf(begin, #endif "%.*g", static_cast(boost::detail::lcast_get_precision()), val); return end > begin; @@ -1570,11 +1570,11 @@ namespace boost { static bool shl_real_type(long double val, char* begin, char*& end) { using namespace std; if (put_inf_nan(begin, end, val)) return true; - end = begin + + end = begin + #if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) sprintf_s(begin, end-begin, #else - sprintf(begin, + sprintf(begin, #endif "%.*Lg", static_cast(boost::detail::lcast_get_precision()), val ); return end > begin; @@ -1641,14 +1641,14 @@ namespace boost { { start = rng.begin(); finish = rng.end(); - return true; + return true; } - + bool operator<<(const iterator_range& rng) BOOST_NOEXCEPT { start = const_cast(rng.begin()); finish = const_cast(rng.end()); - return true; + return true; } bool operator<<(const iterator_range& rng) BOOST_NOEXCEPT @@ -1720,8 +1720,8 @@ namespace boost { bool operator<<(boost::ulong_long_type n) { start = lcast_put_unsigned(n, finish); return true; } bool operator<<(boost::long_long_type n) { return shl_signed(n); } #elif defined(BOOST_HAS_MS_INT64) - bool operator<<(unsigned __int64 n) { start = lcast_put_unsigned(n, finish); return true; } - bool operator<<( __int64 n) { return shl_signed(n); } + bool operator<<(uint64_t n) { start = lcast_put_unsigned(n, finish); return true; } + bool operator<<( int64_t n) { return shl_signed(n); } #endif bool operator<<(float val) { return shl_real_type(val, start, finish); } bool operator<<(double val) { return shl_real_type(val, start, finish); } @@ -1732,7 +1732,7 @@ namespace boost { return shl_real_type(static_cast(val), start, finish); #endif } - + template bool operator<<(boost::array const& input) BOOST_NOEXCEPT { return shl_char_array_limited(input.begin(), N); } @@ -1756,13 +1756,13 @@ namespace boost { template bool operator<<(boost::array const& input) BOOST_NOEXCEPT { return ((*this) << reinterpret_cast const& >(input)); } - + #ifndef BOOST_NO_CXX11_HDR_ARRAY template bool operator<<(std::array const& input) BOOST_NOEXCEPT - { + { if (input.size()) return shl_char_array_limited(&input[0], N); - else return true; + else return true; } template @@ -1775,9 +1775,9 @@ namespace boost { template bool operator<<(std::array const& input) BOOST_NOEXCEPT - { + { if (input.size()) return shl_char_array_limited(&input[0], N); - else return true; + else return true; } template @@ -1788,7 +1788,7 @@ namespace boost { bool operator<<(std::array const& input) BOOST_NOEXCEPT { return ((*this) << reinterpret_cast const& >(input)); } #endif - + template bool operator<<(const InStreamable& input) { return shl_input_streamable(input); } @@ -1927,8 +1927,8 @@ namespace boost { bool operator>>(boost::ulong_long_type& output) { return shr_unsigned(output); } bool operator>>(boost::long_long_type& output) { return shr_signed(output); } #elif defined(BOOST_HAS_MS_INT64) - bool operator>>(unsigned __int64& output) { return shr_unsigned(output); } - bool operator>>(__int64& output) { return shr_signed(output); } + bool operator>>(uint64_t& output) { return shr_unsigned(output); } + bool operator>>(int64_t& output) { return shr_signed(output); } #endif bool operator>>(char& output) { return shr_xchar(output); } bool operator>>(unsigned char& output) { return shr_xchar(output); } @@ -1948,14 +1948,14 @@ namespace boost { template bool operator>>(boost::container::basic_string& str) { str.assign(start, finish); return true; } - + private: template bool shr_std_array(ArrayT& output) BOOST_NOEXCEPT { using namespace std; const std::size_t size = finish - start; - if (size > N - 1) { // `-1` because we need to store \0 at the end + if (size > N - 1) { // `-1` because we need to store \0 at the end return false; } @@ -1968,39 +1968,39 @@ namespace boost { template bool operator>>(boost::array& output) BOOST_NOEXCEPT - { - return shr_std_array(output); + { + return shr_std_array(output); } template - bool operator>>(boost::array& output) - { - return ((*this) >> reinterpret_cast& >(output)); + bool operator>>(boost::array& output) + { + return ((*this) >> reinterpret_cast& >(output)); } template - bool operator>>(boost::array& output) - { - return ((*this) >> reinterpret_cast& >(output)); + bool operator>>(boost::array& output) + { + return ((*this) >> reinterpret_cast& >(output)); } - + #ifndef BOOST_NO_CXX11_HDR_ARRAY template bool operator>>(std::array& output) BOOST_NOEXCEPT - { - return shr_std_array(output); + { + return shr_std_array(output); } template - bool operator>>(std::array& output) - { - return ((*this) >> reinterpret_cast& >(output)); + bool operator>>(std::array& output) + { + return ((*this) >> reinterpret_cast& >(output)); } template bool operator>>(std::array& output) - { - return ((*this) >> reinterpret_cast& >(output)); + { + return ((*this) >> reinterpret_cast& >(output)); } #endif @@ -2217,15 +2217,15 @@ namespace boost { static inline Target lexical_cast_impl(const Source& arg) { typedef lexical_cast_stream_traits stream_trait; - + typedef detail::lexical_stream_limited_src< - BOOST_DEDUCED_TYPENAME stream_trait::char_type, - BOOST_DEDUCED_TYPENAME stream_trait::traits, - stream_trait::requires_stringbuf + BOOST_DEDUCED_TYPENAME stream_trait::char_type, + BOOST_DEDUCED_TYPENAME stream_trait::traits, + stream_trait::requires_stringbuf > interpreter_type; // Target type must be default constructible - Target result; + Target result; BOOST_DEDUCED_TYPENAME stream_trait::char_type buf[stream_trait::len_t::value + 1]; stream_trait::len_t::check_coverage(); @@ -2408,7 +2408,7 @@ namespace boost { template inline Target lexical_cast(const CharType* chars, std::size_t count) { - BOOST_STATIC_ASSERT_MSG(boost::detail::is_char_or_wchar::value, + BOOST_STATIC_ASSERT_MSG(boost::detail::is_char_or_wchar::value, "CharType must be a character or wide character type"); return boost::lexical_cast( @@ -2535,10 +2535,10 @@ namespace boost { template Target lexical_cast(Source arg) { - typedef typename detail::widest_char< - BOOST_DEDUCED_TYPENAME detail::stream_char::type - , BOOST_DEDUCED_TYPENAME detail::stream_char::type - >::type char_type; + typedef typename detail::widest_char< + BOOST_DEDUCED_TYPENAME detail::stream_char::type + , BOOST_DEDUCED_TYPENAME detail::stream_char::type + >::type char_type; typedef std::char_traits traits; detail::lexical_stream interpreter; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/limits.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/limits.hpp index d3747a1a..b4f45f7f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/limits.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/limits.hpp @@ -1,5 +1,5 @@ -// (C) Copyright John maddock 1999. +// (C) Copyright John maddock 1999. // (C) David Abrahams 2002. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -23,8 +23,8 @@ || (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)) // Add missing specializations for numeric_limits: #ifdef BOOST_HAS_MS_INT64 -# define BOOST_LLT __int64 -# define BOOST_ULLT unsigned __int64 +# define BOOST_LLT int64_t +# define BOOST_ULLT uint64_t #else # define BOOST_LLT ::boost::long_long_type # define BOOST_ULLT ::boost::ulong_long_type @@ -35,7 +35,7 @@ namespace std { template<> - class numeric_limits + class numeric_limits { public: @@ -84,11 +84,11 @@ namespace std BOOST_STATIC_CONSTANT(bool, traps = false); BOOST_STATIC_CONSTANT(bool, tinyness_before = false); BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero); - + }; template<> - class numeric_limits + class numeric_limits { public: @@ -137,10 +137,10 @@ namespace std BOOST_STATIC_CONSTANT(bool, traps = false); BOOST_STATIC_CONSTANT(bool, tinyness_before = false); BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero); - + }; } -#endif +#endif #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/common_factor_rt.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/common_factor_rt.hpp index 4582a96c..9a825b65 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/common_factor_rt.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/common_factor_rt.hpp @@ -4,13 +4,13 @@ // use, modify, sell and distribute this software is granted provided this // copyright notice appears in all copies. This software is provided "as is" // without express or implied warranty, and with no claim as to its suitability -// for any purpose. +// for any purpose. // boostinspect:nolicense (don't complain about the lack of a Boost license) // (Paul Moore hasn't been in contact for years, so there's no way to change the // license.) -// See http://www.boost.org for updates, documentation, and revision history. +// See http://www.boost.org for updates, documentation, and revision history. #ifndef BOOST_MATH_COMMON_FACTOR_RT_HPP #define BOOST_MATH_COMMON_FACTOR_RT_HPP @@ -314,7 +314,7 @@ namespace detail #ifdef BOOST_HAS_LONG_LONG BOOST_PRIVATE_GCD_UF( boost::ulong_long_type ); #elif defined(BOOST_HAS_MS_INT64) - BOOST_PRIVATE_GCD_UF( unsigned __int64 ); + BOOST_PRIVATE_GCD_UF( uint64_t ); #endif #if CHAR_MIN == 0 @@ -342,7 +342,7 @@ namespace detail #ifdef BOOST_HAS_LONG_LONG BOOST_PRIVATE_GCD_SF( boost::long_long_type, boost::ulong_long_type ); #elif defined(BOOST_HAS_MS_INT64) - BOOST_PRIVATE_GCD_SF( __int64, unsigned __int64 ); + BOOST_PRIVATE_GCD_SF( int64_t, uint64_t ); #endif #undef BOOST_PRIVATE_GCD_SF diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/concepts/real_concept.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/concepts/real_concept.hpp index 1ed2c1df..4e4434eb 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/concepts/real_concept.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/math/concepts/real_concept.hpp @@ -78,8 +78,8 @@ public: real_concept(boost::ulong_long_type c) : m_value(static_cast(c)){} real_concept(boost::long_long_type c) : m_value(static_cast(c)){} #elif defined(BOOST_HAS_MS_INT64) - real_concept(unsigned __int64 c) : m_value(static_cast(c)){} - real_concept(__int64 c) : m_value(static_cast(c)){} + real_concept(uint64_t c) : m_value(static_cast(c)){} + real_concept(int64_t c) : m_value(static_cast(c)){} #endif real_concept(float c) : m_value(c){} real_concept(double c) : m_value(c){} @@ -366,7 +366,7 @@ inline concepts::real_concept epsilon(BOOST_MATH_EXPLICI template <> inline int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(concepts::real_concept)) -{ +{ // Assume number of significand bits is same as real_concept_base_type, // unless std::numeric_limits::is_specialized to provide digits. return tools::digits(); @@ -432,7 +432,7 @@ inline long double real_cast(concepts::real #if BOOST_WORKAROUND(BOOST_MSVC, <= 1310) // -// For some strange reason ADL sometimes fails to find the +// For some strange reason ADL sometimes fails to find the // correct overloads, unless we bring these declarations into scope: // using concepts::itrunc; diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/datatype.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/datatype.hpp index 7fa7e1c3..0c1b3bd1 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/datatype.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/mpi/datatype.hpp @@ -105,7 +105,7 @@ struct is_mpi_byte_datatype * directly to the MPI type @c MPI_INT. When there is a direct * mapping from the type @c T to an MPI type, @c * is_mpi_builtin_datatype will derive from @c mpl::true_ and the MPI - * data type will be accessible via @c get_mpi_datatype. + * data type will be accessible via @c get_mpi_datatype. * * In general, users should not need to specialize this * trait. However, if you have an additional C++ type that can map @@ -240,19 +240,19 @@ BOOST_MPI_DATATYPE(unsigned long, MPI_UNSIGNED_LONG, integer); /// INTERNAL ONLY #define BOOST_MPI_LIST2(A, B) A, B /// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair, MPI_FLOAT_INT, +BOOST_MPI_DATATYPE(std::pair, MPI_FLOAT_INT, builtin); /// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair, MPI_DOUBLE_INT, +BOOST_MPI_DATATYPE(std::pair, MPI_DOUBLE_INT, builtin); /// INTERNAL ONLY BOOST_MPI_DATATYPE(std::pair, MPI_LONG_DOUBLE_INT, builtin); /// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair), MPI_LONG_INT, +BOOST_MPI_DATATYPE(std::pair), MPI_LONG_INT, builtin); /// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair), MPI_SHORT_INT, +BOOST_MPI_DATATYPE(std::pair), MPI_SHORT_INT, builtin); /// INTERNAL ONLY BOOST_MPI_DATATYPE(std::pair), MPI_2INT, builtin); @@ -271,18 +271,18 @@ struct is_mpi_datatype > BOOST_MPI_DATATYPE(wchar_t, MPI_WCHAR, builtin); #endif -// Define long long or __int64 specialization of is_mpi_datatype, if possible. +// Define long long or int64_t specialization of is_mpi_datatype, if possible. #if defined(BOOST_HAS_LONG_LONG) && \ (defined(MPI_LONG_LONG_INT) || (defined(MPI_VERSION) && MPI_VERSION >= 2)) BOOST_MPI_DATATYPE(long long, MPI_LONG_LONG_INT, builtin); #elif defined(BOOST_HAS_MS_INT64) && \ (defined(MPI_LONG_LONG_INT) || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(__int64, MPI_LONG_LONG_INT, builtin); +BOOST_MPI_DATATYPE(int64_t, MPI_LONG_LONG_INT, builtin); #endif -// Define unsigned long long or unsigned __int64 specialization of +// Define unsigned long long or uint64_t specialization of // is_mpi_datatype, if possible. We separate this from the check for -// the (signed) long long/__int64 because some MPI implementations +// the (signed) long long/int64_t because some MPI implementations // (e.g., MPICH-MX) have MPI_LONG_LONG_INT but not // MPI_UNSIGNED_LONG_LONG. #if defined(BOOST_HAS_LONG_LONG) && \ @@ -292,7 +292,7 @@ BOOST_MPI_DATATYPE(unsigned long long, MPI_UNSIGNED_LONG_LONG, builtin); #elif defined(BOOST_HAS_MS_INT64) && \ (defined(MPI_UNSIGNED_LONG_LONG) \ || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(unsigned __int64, MPI_UNSIGNED_LONG_LONG, builtin); +BOOST_MPI_DATATYPE(uint64_t, MPI_UNSIGNED_LONG_LONG, builtin); #endif // Define signed char specialization of is_mpi_datatype, if possible. diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/multi_index/detail/uintptr_type.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/multi_index/detail/uintptr_type.hpp index 529c6231..fdb6078b 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/multi_index/detail/uintptr_type.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/multi_index/detail/uintptr_type.hpp @@ -45,7 +45,7 @@ template<>struct uintptr_candidates<3> {typedef unsigned int type;}; #endif #if defined(BOOST_HAS_MS_INT64) -template<>struct uintptr_candidates<4> {typedef unsigned __int64 type;}; +template<>struct uintptr_candidates<4> {typedef uint64_t type;}; #else template<>struct uintptr_candidates<4> {typedef unsigned int type;}; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/numeric/conversion/detail/old_numeric_cast.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/numeric/conversion/detail/old_numeric_cast.hpp index 47b86d2c..554fed92 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/numeric/conversion/detail/old_numeric_cast.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/numeric/conversion/detail/old_numeric_cast.hpp @@ -216,14 +216,14 @@ namespace boost { return x >= 0 && static_cast(static_cast(x)) != x; } # if defined(BOOST_MSVC) && BOOST_MSVC < 1300 - // MSVC6 can't static_cast unsigned __int64 -> floating types + // MSVC6 can't static_cast uint64_t -> floating types # define BOOST_UINT64_CAST(src_type) \ - static inline bool check(src_type x, unsigned __int64) \ + static inline bool check(src_type x, uint64_t) \ { \ if (x < 0) return false; \ - unsigned __int64 y = static_cast(x); \ + uint64_t y = static_cast(x); \ bool odd = y & 0x1; \ - __int64 div2 = static_cast<__int64>(y >> 1); \ + int64_t div2 = static_cast(y >> 1); \ return ((static_cast(div2) * 2.0) + odd) != x; \ } diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/lwm_win32_cs.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/lwm_win32_cs.hpp index a45e2c2f..c062f68e 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/lwm_win32_cs.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/signals2/detail/lwm_win32_cs.hpp @@ -40,7 +40,7 @@ struct critical_section void * OwningThread; void * LockSemaphore; #if defined(_WIN64) - unsigned __int64 SpinCount; + uint64_t SpinCount; #else unsigned long SpinCount; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/lwm_win32_cs.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/lwm_win32_cs.hpp index 00477e49..55ed22a9 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/lwm_win32_cs.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/smart_ptr/detail/lwm_win32_cs.hpp @@ -37,7 +37,7 @@ struct critical_section void * OwningThread; void * LockSemaphore; #if defined(_WIN64) - unsigned __int64 SpinCount; + uint64_t SpinCount; #else unsigned long SpinCount; #endif diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/complex.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/complex.hpp index 71f44342..7ad90d0c 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/complex.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/tr1/complex.hpp @@ -43,7 +43,7 @@ using boost::math::fabs; #include #include -namespace std{ +namespace std{ #ifdef BOOST_NO_STDC_NAMESPACE using :: atan2; @@ -142,14 +142,14 @@ inline complex polar(const long long& rho, const long long& theta = 0) inline complex polar(const unsigned long long& rho, const unsigned long long& theta = 0) { return ::std::polar(static_cast(rho), static_cast(theta)); } #elif defined(BOOST_HAS_MS_INT64) -inline complex polar(const __int64& rho, const __int64& theta = 0) +inline complex polar(const int64_t& rho, const int64_t& theta = 0) { return ::std::polar(static_cast(rho), static_cast(theta)); } -inline complex polar(const unsigned __int64& rho, const unsigned __int64& theta = 0) +inline complex polar(const uint64_t& rho, const uint64_t& theta = 0) { return ::std::polar(static_cast(rho), static_cast(theta)); } #endif -template -inline complex::type> +template +inline complex::type> polar(const T& rho, const U& theta) { typedef typename boost::tr1_detail::promote_to_real::type real_type; @@ -210,7 +210,7 @@ inline complex::type> cast2_type y1(y); return std::pow(x1, y1); } -template +template inline complex::type> pow (const complex& x, const U& y) { @@ -223,7 +223,7 @@ inline complex::type> return std::pow(x1, y1); } -template +template inline complex::type> pow (const T& x, const complex& y) { diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/integral_promotion.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/integral_promotion.hpp index 2109b9c6..475971bd 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/integral_promotion.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/integral_promotion.hpp @@ -54,8 +54,8 @@ BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int16) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int32 ) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int32) #ifdef __BORLANDC__ -BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) -BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(uint64_t) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( int64_t) #endif #endif @@ -63,8 +63,8 @@ BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::ulong_long_type) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::long_long_type ) #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) -BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(uint64_t) +BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( int64_t) #endif #undef BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE @@ -99,7 +99,7 @@ BOOST_TT_AUX_PROMOTE_FROM_INDEX(4, unsigned long) // WARNING: integral promotions to non-standard types -// long long and __int64 are not defined by the standard. +// long long and int64_t are not defined by the standard. // Additional specialisations and overloads shouldn't // introduce ambiguity, though. @@ -107,8 +107,8 @@ BOOST_TT_AUX_PROMOTE_FROM_INDEX(4, unsigned long) BOOST_TT_AUX_PROMOTE_FROM_INDEX(5, boost::long_long_type ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(6, boost::ulong_long_type) #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_PROMOTE_FROM_INDEX(7, __int64 ) -BOOST_TT_AUX_PROMOTE_FROM_INDEX(8, unsigned __int64) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(7, int64_t ) +BOOST_TT_AUX_PROMOTE_FROM_INDEX(8, uint64_t) #endif #undef BOOST_TT_AUX_PROMOTE_FROM_INDEX @@ -142,8 +142,8 @@ BOOST_TT_AUX_PROMOTED_INDEX_TESTER(4, unsigned long) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(5, boost::long_long_type ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(6, boost::ulong_long_type) #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_PROMOTED_INDEX_TESTER(7, __int64 ) -BOOST_TT_AUX_PROMOTED_INDEX_TESTER(8, unsigned __int64) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(7, int64_t ) +BOOST_TT_AUX_PROMOTED_INDEX_TESTER(8, uint64_t) #endif #undef BOOST_TT_AUX_PROMOTED_INDEX_TESTER diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/is_integral.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/is_integral.hpp index 4ca97340..3ef776d7 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/is_integral.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/is_integral.hpp @@ -56,8 +56,8 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int16,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int32,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int32,true) #ifdef __BORLANDC__ -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,uint64_t,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,int64_t,true) #endif #endif @@ -65,10 +65,10 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::ulong_long_type,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, ::boost::long_long_type,true) #elif defined(BOOST_HAS_MS_INT64) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,unsigned __int64,true) -BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,uint64_t,true) +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,int64_t,true) #endif - + #ifdef BOOST_HAS_INT128 BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_signed.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_signed.hpp index 7deb8555..ea3a0ac4 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_signed.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_signed.hpp @@ -45,7 +45,7 @@ struct make_signed_imp typedef typename remove_cv::type t_no_cv; typedef typename mpl::if_c< - (::boost::type_traits::ice_and< + (::boost::type_traits::ice_and< ::boost::is_signed::value, ::boost::is_integral::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, @@ -53,7 +53,7 @@ struct make_signed_imp ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), T, typename mpl::if_c< - (::boost::type_traits::ice_and< + (::boost::type_traits::ice_and< ::boost::is_integral::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, @@ -74,15 +74,15 @@ struct make_signed_imp #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 typename mpl::if_c< - sizeof(t_no_cv) == sizeof(boost::long_long_type), - boost::long_long_type, + sizeof(t_no_cv) == sizeof(boost::long_long_type), + boost::long_long_type, boost::int128_type >::type #else boost::long_long_type #endif #elif defined(BOOST_HAS_MS_INT64) - __int64 + int64_t #else long #endif @@ -106,15 +106,15 @@ struct make_signed_imp #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 typename mpl::if_c< - sizeof(t_no_cv) == sizeof(boost::long_long_type), - boost::long_long_type, + sizeof(t_no_cv) == sizeof(boost::long_long_type), + boost::long_long_type, boost::int128_type >::type #else boost::long_long_type #endif #elif defined(BOOST_HAS_MS_INT64) - __int64 + int64_t #else long #endif @@ -124,14 +124,14 @@ struct make_signed_imp >::type >::type >::type base_integer_type; - + // Add back any const qualifier: typedef typename mpl::if_< is_const, typename add_const::type, base_integer_type >::type const_base_integer_type; - + // Add back any volatile qualifier: typedef typename mpl::if_< is_volatile, diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_unsigned.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_unsigned.hpp index 7e2fcdc4..77af984a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_unsigned.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/type_traits/make_unsigned.hpp @@ -45,7 +45,7 @@ struct make_unsigned_imp typedef typename remove_cv::type t_no_cv; typedef typename mpl::if_c< - (::boost::type_traits::ice_and< + (::boost::type_traits::ice_and< ::boost::is_unsigned::value, ::boost::is_integral::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, @@ -53,7 +53,7 @@ struct make_unsigned_imp ::boost::type_traits::ice_not< ::boost::is_same::value>::value >::value), T, typename mpl::if_c< - (::boost::type_traits::ice_and< + (::boost::type_traits::ice_and< ::boost::is_integral::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, ::boost::type_traits::ice_not< ::boost::is_same::value>::value, @@ -74,15 +74,15 @@ struct make_unsigned_imp #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 typename mpl::if_c< - sizeof(t_no_cv) == sizeof(boost::ulong_long_type), - boost::ulong_long_type, + sizeof(t_no_cv) == sizeof(boost::ulong_long_type), + boost::ulong_long_type, boost::uint128_type >::type #else boost::ulong_long_type #endif #elif defined(BOOST_HAS_MS_INT64) - unsigned __int64 + uint64_t #else unsigned long #endif @@ -106,15 +106,15 @@ struct make_unsigned_imp #if defined(BOOST_HAS_LONG_LONG) #ifdef BOOST_HAS_INT128 typename mpl::if_c< - sizeof(t_no_cv) == sizeof(boost::ulong_long_type), - boost::ulong_long_type, + sizeof(t_no_cv) == sizeof(boost::ulong_long_type), + boost::ulong_long_type, boost::uint128_type >::type #else boost::ulong_long_type #endif #elif defined(BOOST_HAS_MS_INT64) - unsigned __int64 + uint64_t #else unsigned long #endif @@ -124,14 +124,14 @@ struct make_unsigned_imp >::type >::type >::type base_integer_type; - + // Add back any const qualifier: typedef typename mpl::if_< is_const, typename add_const::type, base_integer_type >::type const_base_integer_type; - + // Add back any volatile qualifier: typedef typename mpl::if_< is_volatile, diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/typeof/register_fundamental.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/typeof/register_fundamental.hpp index 3a15888d..4c461c8f 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/typeof/register_fundamental.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/typeof/register_fundamental.hpp @@ -44,8 +44,8 @@ BOOST_TYPEOF_REGISTER_TYPE(__int16) BOOST_TYPEOF_REGISTER_TYPE(unsigned __int32) BOOST_TYPEOF_REGISTER_TYPE(__int32) #ifdef __BORLANDC__ -BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64) -BOOST_TYPEOF_REGISTER_TYPE(__int64) +BOOST_TYPEOF_REGISTER_TYPE(uint64_t) +BOOST_TYPEOF_REGISTER_TYPE(int64_t) #endif #endif @@ -53,8 +53,8 @@ BOOST_TYPEOF_REGISTER_TYPE(__int64) BOOST_TYPEOF_REGISTER_TYPE(::boost::ulong_long_type) BOOST_TYPEOF_REGISTER_TYPE(::boost::long_long_type) #elif defined(BOOST_HAS_MS_INT64) -BOOST_TYPEOF_REGISTER_TYPE(unsigned __int64) -BOOST_TYPEOF_REGISTER_TYPE(__int64) +BOOST_TYPEOF_REGISTER_TYPE(uint64_t) +BOOST_TYPEOF_REGISTER_TYPE(int64_t) #endif BOOST_TYPEOF_REGISTER_TYPE(void) diff --git a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/wave_config.hpp b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/wave_config.hpp index ec712ef1..a49a641a 100644 --- a/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/wave_config.hpp +++ b/Minecraft.Client/PS3/PS3Extras/boost_1_53_0/boost/wave/wave_config.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library Global application configuration - + http://www.boost.org/ Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost @@ -20,10 +20,10 @@ #include /////////////////////////////////////////////////////////////////////////////// -// Define the maximal include nesting depth allowed. If this value isn't +// Define the maximal include nesting depth allowed. If this value isn't // defined it defaults to 1024 // -// To define a new initial include nesting define the following constant +// To define a new initial include nesting define the following constant // before including this file. // #if !defined(BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH) @@ -33,7 +33,7 @@ /////////////////////////////////////////////////////////////////////////////// // Decide, whether to support variadics and placemarkers // -// To implement support variadics and placemarkers define the following to +// To implement support variadics and placemarkers define the following to // something not equal to zero. // #if !defined(BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS) @@ -41,10 +41,10 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether to implement a #warning directive as an extension to the +// Decide, whether to implement a #warning directive as an extension to the // C++ Standard (same as #error, but emits a warning, not an error) // -// To disable the implementation of #warning directives, define the following +// To disable the implementation of #warning directives, define the following // constant as zero before including this file. // #if !defined(BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE) @@ -52,9 +52,9 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether to implement #pragma once +// Decide, whether to implement #pragma once // -// To disable the implementation of #pragma once, define the following +// To disable the implementation of #pragma once, define the following // constant as zero before including this file. // #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_ONCE) @@ -62,9 +62,9 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether to implement #pragma message("") +// Decide, whether to implement #pragma message("") // -// To disable the implementation of #pragma message(""), define the following +// To disable the implementation of #pragma message(""), define the following // constant as zero before including this file. // #if !defined(BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE) @@ -75,7 +75,7 @@ // Decide, whether to implement #include_next // Please note, that this is an extension to the C++ Standard. // -// To disable the implementation of #include_next, define the following +// To disable the implementation of #include_next, define the following // constant as zero before including this file. // #if !defined(BOOST_WAVE_SUPPORT_INCLUDE_NEXT) @@ -85,7 +85,7 @@ /////////////////////////////////////////////////////////////////////////////// // Decide, whether to support C++11 // -// To implement C++11 keywords and preprocessor semantics define the following +// To implement C++11 keywords and preprocessor semantics define the following // to something not equal to zero. // #if !defined(BOOST_WAVE_SUPPORT_CPP0X) @@ -96,11 +96,11 @@ /////////////////////////////////////////////////////////////////////////////// // Undefine the following, to enable some MS specific language extensions: -// __int8, __int16, __int32, __int64, __based, __declspec, __cdecl, +// __int8, __int16, __int32, int64_t, __based, __declspec, __cdecl, // __fastcall, __stdcall, __try, __except, __finally, __leave, __inline, // __asm, #region, #endregion // -// Note: By default this is enabled for Windows based systems, otherwise it's +// Note: By default this is enabled for Windows based systems, otherwise it's // disabled. #if !defined(BOOST_WAVE_SUPPORT_MS_EXTENSIONS) #if defined(BOOST_WINDOWS) @@ -111,10 +111,10 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Allow the message body of the #error and #warning directives to be +// Allow the message body of the #error and #warning directives to be // preprocessed before the diagnostic is issued. // -// To disable preprocessing of the body of #error and #warning directives, +// To disable preprocessing of the body of #error and #warning directives, // define the following constant as zero before including this file. // #if !defined(BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY) @@ -122,10 +122,10 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Allow the #pragma directives to be returned to the caller (optionally after -// preprocessing the body) +// Allow the #pragma directives to be returned to the caller (optionally after +// preprocessing the body) // -// To disable the library to emit unknown #pragma directives, define the +// To disable the library to emit unknown #pragma directives, define the // following constant as zero before including this file. // #if !defined(BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES) @@ -133,10 +133,10 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Allow the body of a #pragma directive to be preprocessed before the +// Allow the body of a #pragma directive to be preprocessed before the // directive is returned to the caller. // -// To disable the preprocessing of the body of #pragma directives, define the +// To disable the preprocessing of the body of #pragma directives, define the // following constant as zero before including this file. // #if !defined(BOOST_WAVE_PREPROCESS_PRAGMA_BODY) @@ -146,7 +146,7 @@ /////////////////////////////////////////////////////////////////////////////// // Allow to define macros with the command line syntax (-DMACRO(x)=definition) // -// To disable the possibility to define macros based on the command line +// To disable the possibility to define macros based on the command line // syntax, define the following constant as zero before including this file. // #if !defined(BOOST_WAVE_ENABLE_COMMANDLINE_MACROS) @@ -155,27 +155,27 @@ /////////////////////////////////////////////////////////////////////////////// // Define the pragma keyword to be used by the library to recognize its own -// pragma's. If nothing else is defined, then 'wave' will be used as the -// default keyword, i.e. the library recognizes all +// pragma's. If nothing else is defined, then 'wave' will be used as the +// default keyword, i.e. the library recognizes all // // #pragma wave option [(argument)] // -// and dispatches the handling to the interpret_pragma() preprocessing hook +// and dispatches the handling to the interpret_pragma() preprocessing hook // function (see file: preprocessing_hooks.hpp). The arguments part of the // pragma is optional. // The BOOST_WAVE_PRAGMA_KEYWORD constant needs to be defined to // resolve as a string literal value. #if !defined(BOOST_WAVE_PRAGMA_KEYWORD) #define BOOST_WAVE_PRAGMA_KEYWORD "wave" -#endif +#endif /////////////////////////////////////////////////////////////////////////////// -// Configure Wave thread support, Boost.Spirit and Boost.Pool are configured +// Configure Wave thread support, Boost.Spirit and Boost.Pool are configured // based on these settings automatically // -// If BOOST_WAVE_SUPPORT_THREADING is not defined, Wave will use the global +// If BOOST_WAVE_SUPPORT_THREADING is not defined, Wave will use the global // Boost build settings (BOOST_HAS_THREADS), if it is defined its value -// defines, whether threading will be enabled or not (should be set to '0' +// defines, whether threading will be enabled or not (should be set to '0' // or '1'). #if !defined(BOOST_WAVE_SUPPORT_THREADING) #if defined(BOOST_HAS_THREADS) @@ -185,7 +185,7 @@ #endif #endif -#if BOOST_WAVE_SUPPORT_THREADING != 0 +#if BOOST_WAVE_SUPPORT_THREADING != 0 #define BOOST_SPIRIT_THREADSAFE 1 #define PHOENIX_THREADSAFE 1 #else @@ -194,18 +194,18 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Define the string type to be used to store the token values and the file +// Define the string type to be used to store the token values and the file // names inside a file_position template class // #if !defined(BOOST_WAVE_STRINGTYPE) -// VC7 isn't able to compile the flex_string class, fall back to std::string +// VC7 isn't able to compile the flex_string class, fall back to std::string // CW up to 8.3 chokes as well *sigh* // Tru64/CXX has linker problems when using flex_string #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || \ BOOST_WORKAROUND(__MWERKS__, < 0x3200) || \ (defined(__DECCXX) && defined(__alpha)) || \ - defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) + defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) #define BOOST_WAVE_STRINGTYPE std::string @@ -223,8 +223,8 @@ > \ > \ /**/ - -// This include is needed for the flex_string class used in the + +// This include is needed for the flex_string class used in the // BOOST_WAVE_STRINGTYPE above. #include @@ -237,13 +237,13 @@ // #define BOOST_SPIRIT_USE_LIST_FOR_TREES /////////////////////////////////////////////////////////////////////////////// -// The following definition forces the Spirit tree code to use boost pool +// The following definition forces the Spirit tree code to use boost pool // allocators instead of the std::allocator for the vector/list's. // #define BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES /////////////////////////////////////////////////////////////////////////////// -// Uncomment the following, if you need debug output, the -// BOOST_SPIRIT_DEBUG_FLAGS_CPP constants below help to fine control the +// Uncomment the following, if you need debug output, the +// BOOST_SPIRIT_DEBUG_FLAGS_CPP constants below help to fine control the // amount of the generated debug output. //#define BOOST_SPIRIT_DEBUG @@ -262,16 +262,16 @@ #if !defined(BOOST_SPIRIT_DEBUG_FLAGS_CPP) #define BOOST_SPIRIT_DEBUG_FLAGS_CPP 0 // default is no debugging -#endif +#endif /////////////////////////////////////////////////////////////////////////////// // -// For all recognized preprocessor statements the output parse trees -// formatted as xml are printed. The formatted parse trees are streamed to the +// For all recognized preprocessor statements the output parse trees +// formatted as xml are printed. The formatted parse trees are streamed to the // std::ostream defined by the WAVE_DUMP_PARSE_TREE_OUT constant. // -// To enable the output of these parse trees, define the following constant -// as zero something not equal to zero before including this file. +// To enable the output of these parse trees, define the following constant +// as zero something not equal to zero before including this file. // #if !defined(BOOST_WAVE_DUMP_PARSE_TREE) #define BOOST_WAVE_DUMP_PARSE_TREE 0 @@ -283,10 +283,10 @@ /////////////////////////////////////////////////////////////////////////////// // // For all #if and #elif directives the preprocessed expressions are printed. -// These expressions are streamed to the std::ostream defined by the +// These expressions are streamed to the std::ostream defined by the // BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS_OUT constant. // -// To enable the output of the preprocessed expressions, define the following +// To enable the output of the preprocessed expressions, define the following // constant as something not equal to zero before including this file. // #if !defined(BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS) @@ -298,14 +298,14 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether to use the separate compilation model for the instantiation +// Decide, whether to use the separate compilation model for the instantiation // of the C++ lexer objects. // // If this is defined, you should explicitly instantiate the C++ lexer // template with the correct parameters in a separate compilation unit of -// your program (see the file instantiate_re2c_lexer.cpp). +// your program (see the file instantiate_re2c_lexer.cpp). // -// To use the lexer inclusion model, define the following constant as +// To use the lexer inclusion model, define the following constant as // something not equal to zero before including this file. // #if !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION) @@ -313,14 +313,14 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether to use the separate compilation model for the instantiation +// Decide, whether to use the separate compilation model for the instantiation // of the grammar objects. // // If this is defined, you should explicitly instantiate the grammar // templates with the correct parameters in a separate compilation unit of -// your program (see the files instantiate_cpp_grammar.cpp et.al.). +// your program (see the files instantiate_cpp_grammar.cpp et.al.). // -// To use the grammar inclusion model, define the following constant as +// To use the grammar inclusion model, define the following constant as // something not equal to zero before including this file. // #if !defined(BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION) @@ -329,9 +329,9 @@ /////////////////////////////////////////////////////////////////////////////// // Decide whether to use a strict C++ lexer. -// -// If this is defined to something != 0, then the C++ lexers recognize the -// strict C99/C++ basic source character set. If it is not defined or defined +// +// If this is defined to something != 0, then the C++ lexers recognize the +// strict C99/C++ basic source character set. If it is not defined or defined // to zero, the C++ lexers recognize the '$' character as part of identifiers. // // The default is to recognize the '$' character as part of identifiers. @@ -341,14 +341,14 @@ #endif /////////////////////////////////////////////////////////////////////////////// -// Decide, whether the serialization of the wave::context class should be +// Decide, whether the serialization of the wave::context class should be // supported // // If this is defined to something not equal to zero the generated code will -// expose routines allowing to store and reload the internal state of the +// expose routines allowing to store and reload the internal state of the // wave::context object. // -// To enable the availability of the serialization functionality, define the +// To enable the availability of the serialization functionality, define the // following constant as something not equal to zero before including this file. // #if !defined(BOOST_WAVE_SERIALIZATION) @@ -368,19 +368,19 @@ /////////////////////////////////////////////////////////////////////////////// // Decide, whether to support long long integers in the preprocessor. // -// The C++ standard requires the preprocessor to use one of the following -// types for integer literals: long or unsigned long depending on an optional +// The C++ standard requires the preprocessor to use one of the following +// types for integer literals: long or unsigned long depending on an optional // suffix ('u', 'l', 'ul', or 'lu') // // Sometimes it's required to preprocess integer literals bigger than that -// (i.e. long long or unsigned long long). In this case you need to define the +// (i.e. long long or unsigned long long). In this case you need to define the // BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS to something not equal to zero. // -// This pp constant is effective only, if your target platform supports +// This pp constant is effective only, if your target platform supports // long long integers (BOOST_HAS_LONG_LONG is defined). // // Please note, that this setting doesn't relate to the Wave support option -// support_option_long_long, which enables the recognition of 'll' suffixes +// support_option_long_long, which enables the recognition of 'll' suffixes // only. // // Defining this pp constant enables the recognition of long long integers @@ -390,7 +390,7 @@ #define BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS 0 #endif -namespace boost { namespace wave +namespace boost { namespace wave { #if defined(BOOST_HAS_LONG_LONG) && \ BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS != 0 @@ -404,7 +404,7 @@ namespace boost { namespace wave /////////////////////////////////////////////////////////////////////////////// // On some platforms Wave will not be able to properly detect whether wchar_t -// is representing a signed or unsigned integral data type. Use the +// is representing a signed or unsigned integral data type. Use the // configuration constants below to force wchar_t being signed or unsigned, as // appropriate. // @@ -424,7 +424,7 @@ namespace boost { namespace wave #define PHOENIX_LIMIT 6 #endif #if PHOENIX_LIMIT < 6 -// boost/home/classic/spirit/classic_attribute.hpp sets PHOENIX_LIMIT to 3! +// boost/home/classic/spirit/classic_attribute.hpp sets PHOENIX_LIMIT to 3! #error "Boost.Wave: the constant PHOENIX_LIMIT must be at least defined to 6" \ " to compile the library." #endif @@ -433,12 +433,12 @@ namespace boost { namespace wave // Set up dll import/export options #if (defined(BOOST_WAVE_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && \ !defined(BOOST_WAVE_STATIC_LINK) - + #if defined(BOOST_WAVE_SOURCE) -#define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT +#define BOOST_WAVE_DECL BOOST_SYMBOL_EXPORT #define BOOST_WAVE_BUILD_DLL #else -#define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT +#define BOOST_WAVE_DECL BOOST_SYMBOL_IMPORT #endif #endif // building a shared library @@ -449,7 +449,7 @@ namespace boost { namespace wave /////////////////////////////////////////////////////////////////////////////// // Auto library naming -#if BOOST_VERSION >= 103100 +#if BOOST_VERSION >= 103100 // auto link features work beginning from Boost V1.31.0 #if !defined(BOOST_WAVE_SOURCE) && !defined(BOOST_ALL_NO_LIB) && \ !defined(BOOST_WAVE_NO_LIB) @@ -467,15 +467,15 @@ namespace boost { namespace wave #endif // BOOST_VERSION /////////////////////////////////////////////////////////////////////////////// -// Compatibility macros +// Compatibility macros // (ensure interface compatibility to older Wave versions) /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // The preprocessing hook signatures changed after the Boost V1.34.0 release // -// To use the preprocessing hook signatures as released with Boost V1.34.0 -// you need to define the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS +// To use the preprocessing hook signatures as released with Boost V1.34.0 +// you need to define the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS // constant to something not equal zero. // // To force using the new interface define this constant to zero. diff --git a/Minecraft.Client/PS3/PS3_App.cpp b/Minecraft.Client/PS3/PS3_App.cpp index d2ab7150..86496e2d 100644 --- a/Minecraft.Client/PS3/PS3_App.cpp +++ b/Minecraft.Client/PS3/PS3_App.cpp @@ -31,7 +31,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() m_bVoiceChatAndUGCRestricted=false; m_bDisplayFullVersionPurchase=false; -// #ifdef _DEBUG_MENUS_ENABLED +// #ifdef _DEBUG_MENUS_ENABLED // debugOverlayCreated = false; // #endif @@ -173,7 +173,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes() WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,NULL); // push this into a vector - + wstring wstrTemp=convStringToWstring(chDLCTitle); m_SONYDLCMap[wstrTemp]=pDLCInfo; } @@ -266,7 +266,7 @@ void CConsoleMinecraftApp::FatalLoadError() aStrings[1] = L"Ðе удалоÑÑŒ загрузить игру \"Minecraft: PlayStation®3 Edition\". Продолжить загрузку невозможно."; aStrings[2] = L"Выйти из игры"; break; - case XC_LANGUAGE_TCHINESE: + case XC_LANGUAGE_TCHINESE: aStrings[0] = L"載入錯誤"; aStrings[1] = L"無法載入「Minecraft: PlayStation®3 Editionã€ï¼Œå› æ­¤ç„¡æ³•繼續。"; aStrings[2] = L"é›¢é–‹éŠæˆ²"; @@ -360,7 +360,7 @@ void CConsoleMinecraftApp::FatalLoadError() } app.DebugPrintf("Requesting Message Box for Fatal Error again due to BUSY\n"); eResult=InputManager.RequestMessageBox(EMSgBoxType_None,0,NULL,this,(char *)u8Message,0); - } + } while(1) { @@ -467,9 +467,9 @@ void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType eType) } LoadSaveDataThreadParam* LoadSaveFromDisk(const wstring& pathName) -{ +{ File saveFile(pathName); - __int64 fileSize = saveFile.length(); + int64_t fileSize = saveFile.length(); FileInputStream fis(saveFile); byteArray ba(fileSize); fis.read(ba); @@ -507,8 +507,8 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __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 -// __int64 seedValue = 0xfd97203ebdbf5c6f; + 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_t seedValue = 0xfd97203ebdbf5c6f; unsigned int seedLow = (unsigned int )(seedValue & 0xffffffff); unsigned int seedHigh = (unsigned int )(seedValue>>32); #ifndef _CONTENT_PACKAGE @@ -595,7 +595,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_GetProductList: - { + { m_eCommerce_State=eCommerce_State_GetProductList_Pending; SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); std::list::iterator iter = pCategories->subCategories.begin(); @@ -611,7 +611,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_AddProductInfoDetailed: - { + { m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending; // for each of the products in the categories, get the detailed info. We really only need the long description and price info. @@ -648,7 +648,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_RegisterDLC: - { + { m_eCommerce_State=eCommerce_State_Online; // register the DLC info SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); @@ -738,16 +738,16 @@ void CConsoleMinecraftApp::ClearCommerceDetails() { for(int i=0;i* pProductList=&m_ProductListA[i]; + std::vector* pProductList=&m_ProductListA[i]; pProductList->clear(); } if(m_ProductListA!=NULL) { - delete [] m_ProductListA; + delete [] m_ProductListA; m_ProductListA=NULL; } - + m_ProductListRetrievedC=0; m_ProductListAdditionalDetailsC=0; m_ProductListCategoriesC=0; @@ -778,11 +778,11 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchDLCProductID,Info.productId)==0) - { + { memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN); return; } - } + } } } return; @@ -791,7 +791,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch void CConsoleMinecraftApp::Checkout(char *pchSkuID) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,pchSkuID); m_eCommerce_State=eCommerce_State_Checkout; } @@ -800,7 +800,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID) void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,pchSkuID); m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased; } @@ -809,7 +809,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) bool CConsoleMinecraftApp::UpgradeTrial() { if(m_eCommerce_State==eCommerce_State_Online) - { + { m_eCommerce_State=eCommerce_State_UpgradeTrial; return true; } @@ -846,12 +846,12 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) { std::vector* pProductList=&m_ProductListA[i]; AUTO_VAR(itEnd, pProductList->end()); - + for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++) { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchTitle,Info.skuId)==0) - { + { if(Info.purchasabilityFlag==SCE_NP_COMMERCE2_SKU_PURCHASABILITY_FLAG_OFF) { return true; @@ -861,7 +861,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) return false; } } - } + } } } return false; @@ -896,7 +896,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err) if(err==0) { pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories; - // allocate the memory for the product info for each categories + // allocate the memory for the product info for each categories if(pClass->m_CategoryInfo.countOfSubCategories>0) { pClass->m_ProductListA = (std::vector *) new std::vector [pClass->m_CategoryInfo.countOfSubCategories]; @@ -928,7 +928,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err { // we're done, so now retrieve the additional product details for each product pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } else { @@ -938,21 +938,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } } // void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err) // { // CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam; -// +// // if(err==0) // { // pScene->m_eCommerce_State=eCommerce_State_Idle; -// //pScene->m_bCommerceProductListRetrieved=true; +// //pScene->m_bCommerceProductListRetrieved=true; // } // //printf("Callback hit, error 0x%08x\n", err); -// +// // } void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err) @@ -971,7 +971,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // MGH - change this to a while loop so we can skip empty categories. do - { + { pClass->m_iCurrentCategory++; }while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategorym_ProductListCategoriesC); @@ -980,12 +980,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // there are no more categories, so we're done pClass->m_eCommerce_State=eCommerce_State_RegisterDLC; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; } else { // continue with the next category - pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; + pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; } } else @@ -997,7 +997,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; pClass->m_iCurrentProduct=0; pClass->m_iCurrentCategory=0; } @@ -1166,7 +1166,7 @@ char *PatchFilelist[] = // "/TitleUpdate/res/font/Default.png", "/TitleUpdate/res/font/Mojangles_7.png", "/TitleUpdate/res/font/Mojangles_11.png", - + "music/music/creative1.binka", "music/music/creative2.binka", "music/music/creative3.binka", @@ -1227,7 +1227,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad) bool bEmptyStore=true; if(pCategories!=NULL) - { + { if(pCategories->countOfProducts>0) { bEmptyStore=false; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h index 30266d7f..3b7ae2c8 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseDataStorage_SPU.h @@ -17,9 +17,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -33,7 +33,7 @@ class SparseDataStorage_SPU { private: // unsigned char planeIndices[128]; - unsigned char* m_pData; + unsigned char* m_pData; // unsigned char *data; // unsigned int allocatedPlaneCount; diff --git a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h index 01b2aa6e..728d1fe5 100644 --- a/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h +++ b/Minecraft.Client/PS3/SPU_Tasks/CompressedTile/SparseLightStorage_SPU.h @@ -20,9 +20,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -36,7 +36,7 @@ class SparseLightStorage_SPU { private: // unsigned char planeIndices[128]; - unsigned char* m_pData; + unsigned char* m_pData; // unsigned char *data; // unsigned int allocatedPlaneCount; diff --git a/Minecraft.Client/PSVita/Iggy/include/rrCore.h b/Minecraft.Client/PSVita/Iggy/include/rrCore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/PSVita/Iggy/include/rrCore.h +++ b/Minecraft.Client/PSVita/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PSVita/Miles/include/mss.h b/Minecraft.Client/PSVita/Miles/include/mss.h index 531dcbc9..754f536b 100644 --- a/Minecraft.Client/PSVita/Miles/include/mss.h +++ b/Minecraft.Client/PSVita/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef uint64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the byte size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/PSVita/Miles/include/rrCore.h b/Minecraft.Client/PSVita/Miles/include/rrCore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/PSVita/Miles/include/rrCore.h +++ b/Minecraft.Client/PSVita/Miles/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.cpp b/Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.cpp index 3d9483d2..e739e92c 100644 --- a/Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.cpp +++ b/Minecraft.Client/PSVita/Network/SonyRemoteStorage_Vita.cpp @@ -44,12 +44,12 @@ void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, break; case GET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Data success \n"); m_status = e_getDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -66,12 +66,12 @@ void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, break; case GET_STATUS_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Get Status success \n"); app.DebugPrintf("Remaining Syncs for this user: %llu\n", outputGetStatus->remainingSyncs); app.DebugPrintf("Number of files on the cloud: %d\n", outputGetStatus->numFiles); - for(int i = 0; i < outputGetStatus->numFiles; i++) + for(int i = 0; i < outputGetStatus->numFiles; i++) { app.DebugPrintf("\n*** File %d information: ***\n", (i + 1)); app.DebugPrintf("File name: %s \n", outputGetStatus->data[i].fileName); @@ -82,8 +82,8 @@ void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, app.DebugPrintf("Visibility: \"%s\" \n", (outputGetStatus->data[i].visibility == 0)?"Private":((outputGetStatus->data[i].visibility == 1)?"Public read only":"Public read and write")); } m_status = e_getStatusSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Get Status was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -98,12 +98,12 @@ void SonyRemoteStorage_Vita::internalCallback(const SceRemoteStorageEvent event, break; case SET_DATA_RESULT: - if(retCode >= 0) + if(retCode >= 0) { app.DebugPrintf("Set Data success \n"); m_status = e_setDataSucceeded; - } - else + } + else { app.DebugPrintf("An error occurred while Set Data was being processed. retCode: 0x%x \n", retCode); m_status = e_error; @@ -175,19 +175,19 @@ bool SonyRemoteStorage_Vita::init(CallbackFunc cb, LPVOID lpParam) // SceNpAuthorizationCode authCode; // memset(&authCode, 0x0, sizeof(authCode)); - + SceNpAuthGetAuthorizationCodeParameter authParams; - memset(&authParams, 0x0, sizeof(authParams)); + memset(&authParams, 0x0, sizeof(authParams)); authParams.size = sizeof(authParams); - authParams.pScope = AUTH_SCOPE; + authParams.pScope = AUTH_SCOPE; memcpy(clientId.id, CLIENT_ID, strlen(CLIENT_ID)); - authParams.pClientId = &clientId; + authParams.pClientId = &clientId; int issuerId = 0; // ret = sceNpAuthGetAuthorizationCode(reqId, &authParams, &authCode, &issuerId); -// if (ret < 0) +// if (ret < 0) // { // app.DebugPrintf("Failed to get auth code 0x%x\n", ret); // sceNpAuthDeleteOAuthRequest(reqId); @@ -195,7 +195,7 @@ bool SonyRemoteStorage_Vita::init(CallbackFunc cb, LPVOID lpParam) // } ret = sceNpAuthDeleteOAuthRequest(reqId); - if (ret < 0) + if (ret < 0) { app.DebugPrintf("Couldn't delete auth request 0x%x\n", ret); return false; @@ -221,11 +221,11 @@ bool SonyRemoteStorage_Vita::init(CallbackFunc cb, LPVOID lpParam) SceRemoteStorageAbortReqParams abortParams; ret = sceRemoteStorageInit(params); - if(ret >= 0) + if(ret >= 0) { abortParams.requestId = ret; app.DebugPrintf("Session will be created \n"); - } + } else if(ret == SCE_REMOTE_STORAGE_ERROR_ALREADY_INITIALISED) { app.DebugPrintf("Session already created \n"); @@ -251,12 +251,12 @@ bool SonyRemoteStorage_Vita::getRemoteFileInfo(SceRemoteStorageStatus* pInfo, Ca reqId = sceRemoteStorageGetStatus(params, outputGetStatus); m_status = e_getStatusInProgress; - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Status request sent \n"); return true; - } - else + } + else { app.DebugPrintf("Error sending Get Status request: 0x%x \n", reqId); return false; @@ -275,11 +275,11 @@ void SonyRemoteStorage_Vita::abort() params.requestId = reqId; int ret = sceRemoteStorageAbort(params); - if(ret >= 0) + if(ret >= 0) { app.DebugPrintf("Abort request done \n"); - } - else + } + else { app.DebugPrintf("Error in Abort request: 0x%x \n", ret); } @@ -317,7 +317,7 @@ bool SonyRemoteStorage_Vita::setDataInternal() char seed[22]; app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack); - __int64 iSeed = strtoll(seed,NULL,10); + int64_t iSeed = strtoll(seed,NULL,10); char seedHex[17]; sprintf(seedHex,"%016llx",iSeed); memcpy(descData.m_seed,seedHex,16); // Don't copy null @@ -345,13 +345,13 @@ bool SonyRemoteStorage_Vita::setDataInternal() reqId = sceRemoteStorageSetData(params); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Set Data request sent \n"); m_bTransferStarted = true; return true; - } - else + } + else { app.DebugPrintf("Error sending Set Data request: 0x%x \n", reqId); return false; @@ -374,13 +374,13 @@ bool SonyRemoteStorage_Vita::getData( const char* remotePath, const char* localP reqId = sceRemoteStorageGetData(params, &s_getDataOutput); app.DebugPrintf("\n*******************************\n"); - if(reqId >= 0) + if(reqId >= 0) { app.DebugPrintf("Get Data request sent \n"); m_bTransferStarted = true; return true; - } - else + } + else { app.DebugPrintf("Error sending Get Data request: 0x%x \n", reqId); return false; diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h index 180ebbbc..9e24befa 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaStubs.h @@ -26,7 +26,7 @@ DWORD TlsAlloc(VOID); LPVOID TlsGetValue(DWORD dwTlsIndex); BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue); -typedef struct _RECT +typedef struct _RECT { LONG left; LONG top; @@ -34,13 +34,13 @@ typedef struct _RECT LONG bottom; } RECT, *PRECT; -typedef struct _TOUCHSCREENRECT +typedef struct _TOUCHSCREENRECT { SceInt16 left; SceInt16 top; SceInt16 right; SceInt16 bottom; -} +} TOUCHSCREENRECT, *PTOUCHSCREENRECT; typedef void ID3D11Device; @@ -58,16 +58,16 @@ typedef int errno_t; // // The following field is used for blocking when there is contention for // // the resource // // -// +// // union { // ULONG_PTR RawEvent[4]; // } Synchronization; -// +// // // // // The following three fields control entering and exiting the critical // // section for the resource // // -// +// // LONG LockCount; // LONG RecursionCount; // HANDLE OwningThread; @@ -261,7 +261,7 @@ typedef struct _MEMORYSTATUS { #define THREAD_PRIORITY_IDLE THREAD_BASE_PRIORITY_IDLE #define WAIT_TIMEOUT 258L -#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) +#define STATUS_ABANDONED_WAIT_0 ((DWORD )0x00000080L) #define WAIT_ABANDONED ((STATUS_ABANDONED_WAIT_0 ) + 0 ) #define MAXUINT_PTR (~((UINT_PTR)0)) @@ -303,17 +303,17 @@ typedef struct _MEMORYSTATUS { #define GENERIC_EXECUTE (0x20000000L) #define GENERIC_ALL (0x10000000L) -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 #define FILE_FLAG_WRITE_THROUGH 0x80000000 #define FILE_FLAG_OVERLAPPED 0x40000000 @@ -333,38 +333,38 @@ typedef struct _MEMORYSTATUS { #define OPEN_ALWAYS 4 #define TRUNCATE_EXISTING 5 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 -#define PAGE_USER_READONLY 0x1000 -#define PAGE_USER_READWRITE 0x2000 -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_NOZERO 0x800000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_HEAP 0x40000000 -#define MEM_16MB_PAGES 0x80000000 +#define PAGE_NOACCESS 0x01 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 +#define PAGE_WRITECOPY 0x08 +#define PAGE_EXECUTE 0x10 +#define PAGE_EXECUTE_READ 0x20 +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_EXECUTE_WRITECOPY 0x80 +#define PAGE_GUARD 0x100 +#define PAGE_NOCACHE 0x200 +#define PAGE_WRITECOMBINE 0x400 +#define PAGE_USER_READONLY 0x1000 +#define PAGE_USER_READWRITE 0x2000 +#define MEM_COMMIT 0x1000 +#define MEM_RESERVE 0x2000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_FREE 0x10000 +#define MEM_PRIVATE 0x20000 +#define MEM_RESET 0x80000 +#define MEM_TOP_DOWN 0x100000 +#define MEM_NOZERO 0x800000 +#define MEM_LARGE_PAGES 0x20000000 +#define MEM_HEAP 0x40000000 +#define MEM_16MB_PAGES 0x80000000 #define IGNORE 0 // Ignore signal #define INFINITE 0xFFFFFFFF // Infinite timeout #define WAIT_FAILED ((DWORD)0xFFFFFFFF) -#define STATUS_WAIT_0 ((DWORD )0x00000000L) +#define STATUS_WAIT_0 ((DWORD )0x00000000L) #define WAIT_OBJECT_0 ((STATUS_WAIT_0 ) + 0 ) -#define STATUS_PENDING ((DWORD )0x00000103L) +#define STATUS_PENDING ((DWORD )0x00000103L) #define STILL_ACTIVE STATUS_PENDING DWORD GetLastError(VOID); @@ -403,9 +403,9 @@ VOID OutputDebugString(LPCSTR lpOutputString); VOID OutputDebugStringA(LPCSTR lpOutputString); errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix); -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix); +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix); -#define __declspec(a) +#define __declspec(a) extern "C" int _wcsicmp (const wchar_t * dst, const wchar_t * src); size_t wcsnlen(const wchar_t *wcs, size_t maxsize); diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h index cc2ddddb..36402d53 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/PSVitaTypes.h @@ -34,14 +34,12 @@ typedef unsigned int *PUINT; typedef unsigned char byte; -typedef long long __int64; -typedef unsigned long long __uint64; typedef unsigned int DWORD; typedef int INT; typedef unsigned long ULONG_PTR, *PULONG_PTR; typedef ULONG_PTR SIZE_T, *PSIZE_T; -typedef __int64 LONG64, *PLONG64; +typedef int64_t LONG64, *PLONG64; #define VOID void typedef char CHAR; diff --git a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp index 87c59535..56eb9654 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp +++ b/Minecraft.Client/PSVita/PSVitaExtras/PsVitaStubs.cpp @@ -56,42 +56,42 @@ void PSVitaInit() int err = sceFiosInitialize(¶ms); assert(err == SCE_FIOS_OK); } -char* getConsoleHomePath() -{ - return contentInfoPath; +char* getConsoleHomePath() +{ + return contentInfoPath; } -char* getUsrDirRoot() -{ - return driveRoot; +char* getUsrDirRoot() +{ + return driveRoot; } -char* getUsrDirPath() -{ - return usrdirPath; +char* getUsrDirPath() +{ + return usrdirPath; } -char* getConsoleHomePathBDPatch() -{ - return contentInfoPathBDPatch; +char* getConsoleHomePathBDPatch() +{ + return contentInfoPathBDPatch; } -char* getUsrDirPathBDPatch() -{ - return usrdirPathBDPatch; +char* getUsrDirPathBDPatch() +{ + return usrdirPathBDPatch; } -char* getDirName() -{ - return dirName; +char* getDirName() +{ + return dirName; } int _wcsicmp( const wchar_t * dst, const wchar_t * src ) { wchar_t f,l; - // validation section + // validation section // _VALIDATE_RETURN(dst != NULL, EINVAL, _NLSCMPERROR); // _VALIDATE_RETURN(src != NULL, EINVAL, _NLSCMPERROR); @@ -117,7 +117,7 @@ size_t wcsnlen(const wchar_t *wcs, size_t maxsize) return n; } -VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) +VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) { SceDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -133,8 +133,8 @@ VOID GetSystemTime( LPSYSTEMTIME lpSystemTime) lpSystemTime->wMilliseconds = sceRtcGetMicrosecond(&dateTime)/1000; } BOOL FileTimeToSystemTime(CONST FILETIME *lpFileTime, LPSYSTEMTIME lpSystemTime) { PSVITA_STUBBED; return false; } -BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) -{ +BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) +{ SceUInt64 diffHundredNanos; SceDateTime dateTime; int err = sceRtcGetCurrentClock(&dateTime, 0); @@ -143,11 +143,11 @@ BOOL SystemTimeToFileTime(CONST SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime) lpFileTime->dwHighDateTime = diffHundredNanos >> 32; lpFileTime->dwLowDateTime = diffHundredNanos & 0xffffffff; - return true; + return true; } -VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) -{ +VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) +{ SceDateTime dateTime; int err = sceRtcGetCurrentClockLocalTime(&dateTime); assert(err == SCE_OK); @@ -163,26 +163,26 @@ VOID GetLocalTime(LPSYSTEMTIME lpSystemTime) } HANDLE CreateEvent(void* lpEventAttributes, BOOL bManualReset, BOOL bInitialState, LPCSTR lpName) { PSVITA_STUBBED; return NULL; } -VOID Sleep(DWORD dwMilliseconds) -{ +VOID Sleep(DWORD dwMilliseconds) +{ C4JThread::Sleep(dwMilliseconds); } BOOL SetThreadPriority(HANDLE hThread, int nPriority) { PSVITA_STUBBED; return FALSE; } DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds) { PSVITA_STUBBED; return false; } -LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) -{ +LONG InterlockedCompareExchangeRelease(LONG volatile *Destination, LONG Exchange,LONG Comperand ) +{ return sceAtomicCompareAndSwap32((int32_t*)Destination, (int32_t)Comperand, (int32_t)Exchange); } -LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) -{ +LONG64 InterlockedCompareExchangeRelease64(LONG64 volatile *Destination, LONG64 Exchange, LONG64 Comperand) +{ return sceAtomicCompareAndSwap64((int64_t*)Destination, (int64_t)Comperand, (int64_t)Exchange); } -VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) { char name[1] = {0}; @@ -191,7 +191,7 @@ VOID InitializeCriticalSection(PCRITICAL_SECTION CriticalSection) } -VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) +VOID InitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION CriticalSection, ULONG SpinCount) { // no spin count on PSVita InitializeCriticalSection(CriticalSection); @@ -203,16 +203,16 @@ VOID DeleteCriticalSection(PCRITICAL_SECTION CriticalSection) PSVITA_ASSERT_SCE_ERROR(err); } -extern CRITICAL_SECTION g_singleThreadCS; +extern CRITICAL_SECTION g_singleThreadCS; -VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID EnterCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = sceKernelLockLwMutex ((SceKernelLwMutexWork *)(&CriticalSection->mutex), 1, NULL); PSVITA_ASSERT_SCE_ERROR(err); } -VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) +VOID LeaveCriticalSection(PCRITICAL_SECTION CriticalSection) { int err = sceKernelUnlockLwMutex ((SceKernelLwMutexWork *)(&CriticalSection->mutex), 1); PSVITA_ASSERT_SCE_ERROR(err); @@ -272,8 +272,8 @@ VOID LeaveCriticalRWSection(PCRITICAL_RW_SECTION CriticalSection, bool Write) -BOOL CloseHandle(HANDLE hObject) -{ +BOOL CloseHandle(HANDLE hObject) +{ sceFiosFHCloseSync(NULL,(SceFiosFH)((int32_t)hObject)); return true; } @@ -292,8 +292,8 @@ BOOL TlsSetValue(DWORD dwTlsIndex, LPVOID lpTlsValue) { return PSVitaTLSStorage: static void* VirtualAllocs[1000]; // a list of 1MB allocations static int VirtualNumAllocs = 0; // how many 1MB chunks have been allocated -LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) -{ +LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) +{ if( flAllocationType == MEM_COMMIT ) { // how many pages do we need @@ -318,7 +318,7 @@ LPVOID VirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWO return (void*) VIRTUAL_OFFSET; } -BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) +BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) { while( VirtualNumAllocs ) { @@ -332,7 +332,7 @@ BOOL VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) // memset a section of the virtual chunks -VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) +VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) { int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on @@ -370,7 +370,7 @@ VOID VirtualMemset(LPVOID lpDestOffset, int val, SIZE_T dwSize) // copy a block of memory to the virtual chunks -VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) +VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) { int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = DestOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on @@ -409,7 +409,7 @@ VOID VirtualCopyTo(LPVOID lpDestOffset, LPVOID lpSrc, SIZE_T dwSize) } // copy a block of memory from the virtual chunks -VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) +VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) { int SrcOffset = ((int)(lpSrcOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int StartPage = SrcOffset / VIRTUAL_PAGE_SIZE; // which 1MB page do we start on @@ -448,7 +448,7 @@ VOID VirtualCopyFrom(LPVOID lpDest, LPVOID lpSrcOffset, SIZE_T dwSize) } // copy a block of memory between the virtual chunks -VOID VirtualMove(LPVOID lpDestOffset, LPVOID lpSrcOffset, SIZE_T dwSize) +VOID VirtualMove(LPVOID lpDestOffset, LPVOID lpSrcOffset, SIZE_T dwSize) { int DestOffset = ((int)(lpDestOffset) - VIRTUAL_OFFSET); // convert the pointer back into a virtual offset int DestChunkOffset = DestOffset % VIRTUAL_PAGE_SIZE; // what is the byte offset within the current 1MB page @@ -651,7 +651,7 @@ DWORD GetFileSize( HANDLE hFile, LPDWORD lpFileSizeHigh ) { SceFiosFH fh = (SceFiosFH)(hFile); - // 4J Stu - sceFiosFHGetSize didn't seem to work...so doing this for now + // 4J Stu - sceFiosFHGetSize didn't seem to work...so doing this for now //SceFiosSize FileSize; //FileSize=sceFiosFHGetSize(fh); SceFiosStat statData; @@ -693,7 +693,7 @@ BOOL WriteFile( HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPD return FALSE; } -BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) +BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped ) { SceFiosFH fh = (SceFiosFH)((int64_t)hFile); // sceFiosFHReadSync - Non-negative values are the number of bytes read, 0 <= result <= length. Negative values are error codes. @@ -742,7 +742,7 @@ void replaceBackslashes(char* szFilename) } } -HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) +HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -767,7 +767,7 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, #ifndef _CONTENT_PACKAGE printf("*** Opening %s\n",filePath); #endif - + SceFiosFH fh; int err = sceFiosFHOpenSync(NULL, &fh, filePath, NULL); assert( err == SCE_FIOS_OK ); @@ -775,8 +775,8 @@ HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, return (void*)fh; } -BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) -{ +BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ #ifndef _CONTENT_PACKAGE char filePath[256]; sprintf(filePath,"%s/%s",usrdirPath, lpPathName ); @@ -793,12 +793,12 @@ BOOL CreateDirectoryA(LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttribu BOOL DeleteFileA(LPCSTR lpFileName) { PSVITA_STUBBED; return false; } -// BOOL XCloseHandle(HANDLE a) -// { -// cellFsClose(int(a)); +// BOOL XCloseHandle(HANDLE a) +// { +// cellFsClose(int(a)); // } -DWORD GetFileAttributesA(LPCSTR lpFileName) +DWORD GetFileAttributesA(LPCSTR lpFileName) { char filePath[256]; std::string mountedPath = StorageManager.GetMountedPath(lpFileName); @@ -834,7 +834,7 @@ VOID DebugBreak(VOID) { SCE_BREAK(); } DWORD GetLastError(VOID) { PSVITA_STUBBED; return 0; } -VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) +VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) { PSVITA_STUBBED; /* malloc_managed_size stat; @@ -849,9 +849,9 @@ VOID GlobalMemoryStatus(LPMEMORYSTATUS lpBuffer) lpBuffer->dwAvailVirtual = stat.max_system_size - stat.current_inuse_size;*/ } -DWORD GetTickCount() +DWORD GetTickCount() { - // This function returns the current system time at this function is called. + // This function returns the current system time at this function is called. // The system time is represented the time elapsed since the system starts up in microseconds. uint64_t sysTime = sceKernelGetProcessTimeWide(); @@ -860,11 +860,11 @@ DWORD GetTickCount() } // we should really use libperf for this kind of thing, but this will do for now. -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) -{ +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ // microseconds - lpFrequency->QuadPart = (1000 * 1000); - return false; + lpFrequency->QuadPart = (1000 * 1000); + return false; } BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { @@ -874,24 +874,24 @@ BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) } #ifndef _FINAL_BUILD -VOID OutputDebugStringW(LPCWSTR lpOutputString) -{ - wprintf(lpOutputString); +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + wprintf(lpOutputString); } -VOID OutputDebugString(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugString(LPCSTR lpOutputString) +{ + printf(lpOutputString); } -VOID OutputDebugStringA(LPCSTR lpOutputString) -{ - printf(lpOutputString); +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + printf(lpOutputString); } #endif // _CONTENT_PACKAGE BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId,LPVOID lpFileInformation) -{ +{ WIN32_FILE_ATTRIBUTE_DATA *fileInfoBuffer = (WIN32_FILE_ATTRIBUTE_DATA*) lpFileInformation; char filePath[256]; @@ -920,32 +920,32 @@ BOOL GetFileAttributesExA(LPCSTR lpFileName,GET_FILEEX_INFO_LEVELS fInfoLevelId, } HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATA lpFindFileData) -{ - PSVITA_STUBBED; +{ + PSVITA_STUBBED; return 0; } -BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) -{ +BOOL FindNextFileA(HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) +{ PSVITA_STUBBED; return false; } errno_t _itoa_s(int _Value, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%d",_Value); else if(_Radix==16) sprintf(_DstBuf,"%lx",_Value); else return -1; return 0; } -errno_t _i64toa_s(__int64 _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } +errno_t _i64toa_s(int64_t _Val, char * _DstBuf, size_t _Size, int _Radix) { if(_Radix==10) sprintf(_DstBuf,"%lld",_Val); else return -1; return 0; } int _wtoi(const wchar_t *_Str) { return wcstol(_Str, NULL, 10); } -DWORD XGetLanguage() -{ +DWORD XGetLanguage() +{ unsigned char ucLang = app.GetMinecraftLanguage(0); SceInt32 iLang; // check if we should override the system language or not - if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) + if(ucLang==MINECRAFT_LANGUAGE_DEFAULT) { sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG,&iLang); } @@ -960,7 +960,7 @@ DWORD XGetLanguage() case SCE_SYSTEM_PARAM_LANG_ENGLISH_US : return XC_LANGUAGE_ENGLISH; case SCE_SYSTEM_PARAM_LANG_FRENCH : return XC_LANGUAGE_FRENCH; - case SCE_SYSTEM_PARAM_LANG_SPANISH : + case SCE_SYSTEM_PARAM_LANG_SPANISH : if(app.IsAmericanSKU()) { return XC_LANGUAGE_LATINAMERICANSPANISH; @@ -995,8 +995,8 @@ DWORD XGetLanguage() } } -DWORD XGetLocale() -{ +DWORD XGetLocale() +{ SceInt32 iLang; sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG,&iLang); switch(iLang) @@ -1005,7 +1005,7 @@ DWORD XGetLocale() case SCE_SYSTEM_PARAM_LANG_ENGLISH_US : return XC_LOCALE_UNITED_STATES; case SCE_SYSTEM_PARAM_LANG_FRENCH : return XC_LOCALE_FRANCE; - case SCE_SYSTEM_PARAM_LANG_SPANISH : + case SCE_SYSTEM_PARAM_LANG_SPANISH : if(app.IsAmericanSKU()) { return XC_LOCALE_LATIN_AMERICA; @@ -1039,7 +1039,7 @@ DWORD XGetLocale() } } -DWORD XEnableGuestSignin(BOOL fEnable) -{ - return 0; +DWORD XEnableGuestSignin(BOOL fEnable) +{ + return 0; } diff --git a/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h b/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h index 20103018..1bbe7067 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/libdivide.h @@ -29,8 +29,8 @@ #if ! LIBDIVIDE_HAS_STDINT_TYPES typedef __int32 int32_t; typedef unsigned __int32 uint32_t; -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; +typedef int64_t int64_t; +typedef uint64_t uint64_t; typedef __int8 int8_t; typedef unsigned __int8 uint8_t; #endif @@ -83,7 +83,7 @@ u32: [0-4] shift value [5] ignored [6] add indicator [7] shift path - + s32: [0-4] shift value [5] shift path [6] add indicator @@ -106,7 +106,7 @@ enum { LIBDIVIDE_U32_SHIFT_PATH = 0x80, LIBDIVIDE_U64_SHIFT_PATH = 0x80, LIBDIVIDE_S32_SHIFT_PATH = 0x20, - LIBDIVIDE_NEGATIVE_DIVISOR = 0x80 + LIBDIVIDE_NEGATIVE_DIVISOR = 0x80 }; @@ -123,7 +123,7 @@ struct libdivide_s32_t { struct libdivide_u64_t { uint64_t magic; uint8_t more; -}; +}; struct libdivide_s64_t { int64_t magic; @@ -146,7 +146,7 @@ LIBDIVIDE_API struct libdivide_s32_t libdivide_s32_gen(int32_t y); LIBDIVIDE_API struct libdivide_u32_t libdivide_u32_gen(uint32_t y); LIBDIVIDE_API struct libdivide_s64_t libdivide_s64_gen(int64_t y); LIBDIVIDE_API struct libdivide_u64_t libdivide_u64_gen(uint64_t y); - + LIBDIVIDE_API int32_t libdivide_s32_do(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do(int64_t numer, const struct libdivide_s64_t *denom); @@ -156,19 +156,19 @@ LIBDIVIDE_API int libdivide_u32_get_algorithm(const struct libdivide_u32_t *deno LIBDIVIDE_API uint32_t libdivide_u32_do_alg0(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do_alg1(uint32_t numer, const struct libdivide_u32_t *denom); LIBDIVIDE_API uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *denom); - + LIBDIVIDE_API int libdivide_u64_get_algorithm(const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg0(uint64_t numer, const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg1(uint64_t numer, const struct libdivide_u64_t *denom); LIBDIVIDE_API uint64_t libdivide_u64_do_alg2(uint64_t numer, const struct libdivide_u64_t *denom); - + LIBDIVIDE_API int libdivide_s32_get_algorithm(const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg0(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg1(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg2(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg3(int32_t numer, const struct libdivide_s32_t *denom); LIBDIVIDE_API int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom); - + LIBDIVIDE_API int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do_alg0(int64_t numer, const struct libdivide_s64_t *denom); LIBDIVIDE_API int64_t libdivide_s64_do_alg1(int64_t numer, const struct libdivide_s64_t *denom); @@ -202,17 +202,17 @@ LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg2(__m128i numers, const struct LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg3(__m128i numers, const struct libdivide_s64_t * denom); LIBDIVIDE_API __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_t * denom); #endif - - - + + + //////// Internal Utility Functions - + static inline uint32_t libdivide__mullhi_u32(uint32_t x, uint32_t y) { uint64_t xl = x, yl = y; uint64_t rl = xl * yl; return (uint32_t)(rl >> 32); } - + static uint64_t libdivide__mullhi_u64(uint64_t x, uint64_t y) { #if HAS_INT128_T __uint128_t xl = x, yl = y; @@ -227,18 +227,18 @@ static uint64_t libdivide__mullhi_u64(uint64_t x, uint64_t y) { const uint64_t x0y1 = x0 * (uint64_t)y1; const uint64_t x1y0 = x1 * (uint64_t)y0; const uint64_t x1y1 = x1 * (uint64_t)y1; - + uint64_t temp = x1y0 + x0y0_hi; uint64_t temp_lo = temp & mask, temp_hi = temp >> 32; return x1y1 + temp_hi + ((temp_lo + x0y1) >> 32); #endif } - + static inline int64_t libdivide__mullhi_s64(int64_t x, int64_t y) { #if HAS_INT128_T __int128_t xl = x, yl = y; __int128_t rl = xl * yl; - return (int64_t)(rl >> 64); + return (int64_t)(rl >> 64); #else //full 128 bits are x0 * y0 + (x0 * y1 << 32) + (x1 * y0 << 32) + (x1 * y1 << 64) const uint32_t mask = 0xFFFFFFFF; @@ -250,7 +250,7 @@ static inline int64_t libdivide__mullhi_s64(int64_t x, int64_t y) { return x1*(int64_t)y1 + (t >> 32) + (w1 >> 32); #endif } - + #if LIBDIVIDE_USE_SSE2 static inline __m128i libdivide__u64_to_m128(uint64_t x) { @@ -275,7 +275,7 @@ static inline __m128i libdivide_get_FFFFFFFF00000000(void) { __m128i result = _mm_set1_epi8(-1); //optimizes to pcmpeqd on OS X return _mm_slli_epi64(result, 32); } - + static inline __m128i libdivide_get_00000000FFFFFFFF(void) { //returns the same as _mm_set1_epi64(0x00000000FFFFFFFFULL) without touching memory __m128i result = _mm_set1_epi8(-1); //optimizes to pcmpeqd on OS X @@ -288,7 +288,7 @@ static inline __m128i libdivide_get_0000FFFF(void) { __m128i result; //we don't care what its contents are result = _mm_cmpeq_epi8(result, result); //all 1s result = _mm_srli_epi32(result, 16); - return result; + return result; } static inline __m128i libdivide_s64_signbits(__m128i v) { @@ -302,7 +302,7 @@ static inline __m128i libdivide_s64_signbits(__m128i v) { static inline __m128i libdivide_u32_to_m128i(uint32_t amt) { return _mm_set_epi32(0, 0, 0, amt); } - + static inline __m128i libdivide_s64_shift_right_vector(__m128i v, int amt) { //implementation of _mm_sra_epi64. Here we have two 64 bit values which are shifted right to logically become (64 - amt) values, and are then sign extended from a (64 - amt) bit number. const int b = 64 - amt; @@ -320,7 +320,7 @@ static inline __m128i libdivide__mullhi_u32_flat_vector(__m128i a, __m128i b) { return _mm_or_si128(hi_product_0Z2Z, hi_product_Z1Z3); // = hi_product_0123 } - + /* Here, y is assumed to contain one 64 bit value repeated twice. */ static inline __m128i libdivide_mullhi_u64_flat_vector(__m128i x, __m128i y) { //full 128 bits are x0 * y0 + (x0 * y1 << 32) + (x1 * y0 << 32) + (x1 * y1 << 64) @@ -331,12 +331,12 @@ static inline __m128i libdivide_mullhi_u64_flat_vector(__m128i x, __m128i y) { const __m128i x0y1 = _mm_mul_epu32(x0, y1); const __m128i x1y0 = _mm_mul_epu32(x1, y0); const __m128i x1y1 = _mm_mul_epu32(x1, y1); - + const __m128i temp = _mm_add_epi64(x1y0, x0y0_hi); __m128i temp_lo = _mm_and_si128(temp, mask), temp_hi = _mm_srli_epi64(temp, 32); temp_lo = _mm_srli_epi64(_mm_add_epi64(temp_lo, x0y1), 32); temp_hi = _mm_add_epi64(x1y1, temp_hi); - + return _mm_add_epi64(temp_lo, temp_hi); } @@ -349,9 +349,9 @@ static inline __m128i libdivide_mullhi_s64_flat_vector(__m128i x, __m128i y) { p = _mm_sub_epi64(p, t2); return p; } - + #ifdef LIBDIVIDE_USE_SSE4_1 - + /* b is one 32 bit value repeated four times. */ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { __m128i hi_product_0Z2Z = _mm_srli_epi64(_mm_mul_epi32(a, b), 32); @@ -359,7 +359,7 @@ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { __m128i hi_product_Z1Z3 = _mm_and_si128(_mm_mul_epi32(a1X3X, b), libdivide_get_FFFFFFFF00000000()); return _mm_or_si128(hi_product_0Z2Z, hi_product_Z1Z3); // = hi_product_0123 } - + #else /* SSE2 does not have a signed multiplication instruction, but we can convert unsigned to signed pretty efficiently. Again, b is just a 32 bit value repeated four times. */ @@ -373,7 +373,7 @@ static inline __m128i libdivide_mullhi_s32_flat_vector(__m128i a, __m128i b) { } #endif #endif - + static inline int32_t libdivide__count_trailing_zeros32(uint32_t val) { #if __GNUC__ || __has_builtin(__builtin_ctz) /* Fast way to count trailing zeros */ @@ -389,7 +389,7 @@ static inline int32_t libdivide__count_trailing_zeros32(uint32_t val) { return result; #endif } - + static inline int32_t libdivide__count_trailing_zeros64(uint64_t val) { #if __LP64__ && (__GNUC__ || __has_builtin(__builtin_ctzll)) /* Fast way to count trailing zeros. Note that we disable this in 32 bit because gcc does something horrible - it calls through to a dynamically bound function. */ @@ -401,11 +401,11 @@ static inline int32_t libdivide__count_trailing_zeros64(uint64_t val) { return 32 + libdivide__count_trailing_zeros32((uint32_t)(val >> 32)); #endif } - + static inline int32_t libdivide__count_leading_zeros32(uint32_t val) { #if __GNUC__ || __has_builtin(__builtin_clzll) /* Fast way to count leading zeros */ - return __builtin_clz(val); + return __builtin_clz(val); #else /* Dorky way to count leading zeros. Note that this hangs for val = 0! */ int32_t result = 0; @@ -413,10 +413,10 @@ static inline int32_t libdivide__count_leading_zeros32(uint32_t val) { val <<= 1; result++; } - return result; + return result; #endif } - + static inline int32_t libdivide__count_leading_zeros64(uint64_t val) { #if __GNUC__ || __has_builtin(__builtin_clzll) /* Fast way to count leading zeros */ @@ -450,7 +450,7 @@ static uint32_t libdivide_64_div_32_to_32(uint32_t u1, uint32_t u0, uint32_t v, return result; } #endif - + #if LIBDIVIDE_IS_X86_64 && LIBDIVIDE_GCC_STYLE_ASM static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { //u0 -> rax @@ -465,10 +465,10 @@ static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, } #else - + /* Code taken from Hacker's Delight, http://www.hackersdelight.org/HDcode/divlu.c . License permits inclusion here per http://www.hackersdelight.org/permissions.htm */ -static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { +static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, uint64_t *r) { const uint64_t b = (1ULL << 32); // Number base (16 bits). uint64_t un1, un0, // Norm. dividend LSD's. vn1, vn0, // Norm. divisor digits. @@ -476,25 +476,25 @@ static uint64_t libdivide_128_div_64_to_64(uint64_t u1, uint64_t u0, uint64_t v, un64, un21, un10,// Dividend digit pairs. rhat; // A remainder. int s; // Shift amount for norm. - + if (u1 >= v) { // If overflow, set rem. if (r != NULL) // to an impossible value, *r = (uint64_t)(-1); // and return the largest return (uint64_t)(-1);} // possible quotient. - + /* count leading zeros */ s = libdivide__count_leading_zeros64(v); // 0 <= s <= 63. - + v = v << s; // Normalize divisor. vn1 = v >> 32; // Break divisor up into vn0 = v & 0xFFFFFFFF; // two 32-bit digits. - + un64 = (u1 << s) | ((u0 >> (64 - s)) & (-s >> 31)); un10 = u0 << s; // Shift dividend left. - + un1 = un10 >> 32; // Break right half of un0 = un10 & 0xFFFFFFFF; // dividend into two digits. - + q1 = un64/vn1; // Compute the first rhat = un64 - q1*vn1; // quotient digit, q1. again1: @@ -502,9 +502,9 @@ again1: q1 = q1 - 1; rhat = rhat + vn1; if (rhat < b) goto again1;} - + un21 = un64*b + un1 - q1*v; // Multiply and subtract. - + q0 = un21/vn1; // Compute the second rhat = un21 - q0*vn1; // quotient digit, q0. again2: @@ -512,21 +512,21 @@ again2: q0 = q0 - 1; rhat = rhat + vn1; if (rhat < b) goto again2;} - + if (r != NULL) // If remainder is wanted, *r = (un21*b + un0 - q0*v) >> s; // return it. return q1*b + q0; } #endif - + #if LIBDIVIDE_ASSERTIONS_ON #define LIBDIVIDE_ASSERT(x) do { if (! (x)) { fprintf(stderr, "Assertion failure on line %ld: %s\n", (long)__LINE__, #x); exit(-1); } } while (0) #else -#define LIBDIVIDE_ASSERT(x) +#define LIBDIVIDE_ASSERT(x) #endif - + #ifndef LIBDIVIDE_HEADER_ONLY - + ////////// UINT32 struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { @@ -537,14 +537,14 @@ struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { } else { const uint32_t floor_log_2_d = 31 - libdivide__count_leading_zeros32(d); - + uint8_t more; uint32_t rem, proposed_m; proposed_m = libdivide_64_div_32_to_32(1U << floor_log_2_d, 0, d, &rem); LIBDIVIDE_ASSERT(rem > 0 && rem < d); const uint32_t e = d - rem; - + /* This power works if e < 2**floor_log_2_d. */ if (e < (1U << floor_log_2_d)) { /* This power works */ @@ -560,7 +560,7 @@ struct libdivide_u32_t libdivide_u32_gen(uint32_t d) { result.magic = 1 + proposed_m; result.more = more; //result.more's shift should in general be ceil_log_2_d. But if we used the smaller power, we subtract one from the shift because we're using the smaller power. If we're using the larger power, we subtract one from the shift because it's taken care of by the add indicator. So floor_log_2_d happens to be correct in both cases. - + } return result; } @@ -582,23 +582,23 @@ uint32_t libdivide_u32_do(uint32_t numer, const struct libdivide_u32_t *denom) { } } - + int libdivide_u32_get_algorithm(const struct libdivide_u32_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U32_SHIFT_PATH) return 0; else if (! (more & LIBDIVIDE_ADD_MARKER)) return 1; else return 2; } - + uint32_t libdivide_u32_do_alg0(uint32_t numer, const struct libdivide_u32_t *denom) { return numer >> (denom->more & LIBDIVIDE_32_SHIFT_MASK); } - + uint32_t libdivide_u32_do_alg1(uint32_t numer, const struct libdivide_u32_t *denom) { uint32_t q = libdivide__mullhi_u32(denom->magic, numer); return q >> denom->more; -} - +} + uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *denom) { // denom->add != 0 uint32_t q = libdivide__mullhi_u32(denom->magic, numer); @@ -608,8 +608,8 @@ uint32_t libdivide_u32_do_alg2(uint32_t numer, const struct libdivide_u32_t *den - -#if LIBDIVIDE_USE_SSE2 + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_u32_do_vector(__m128i numers, const struct libdivide_u32_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U32_SHIFT_PATH) { @@ -622,7 +622,7 @@ __m128i libdivide_u32_do_vector(__m128i numers, const struct libdivide_u32_t *de //return t >> denom->shift; __m128i t = _mm_add_epi32(_mm_srli_epi32(_mm_sub_epi32(numers, q), 1), q); return _mm_srl_epi32(t, libdivide_u32_to_m128i(more & LIBDIVIDE_32_SHIFT_MASK)); - + } else { //q >> denom->shift @@ -647,7 +647,7 @@ __m128i libdivide_u32_do_vector_alg2(__m128i numers, const struct libdivide_u32_ } #endif - + /////////// UINT64 struct libdivide_u64_t libdivide_u64_gen(uint64_t d) { @@ -658,14 +658,14 @@ struct libdivide_u64_t libdivide_u64_gen(uint64_t d) { } else { const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(d); - + uint64_t proposed_m, rem; uint8_t more; proposed_m = libdivide_128_div_64_to_64(1ULL << floor_log_2_d, 0, d, &rem); //== (1 << (64 + floor_log_2_d)) / d LIBDIVIDE_ASSERT(rem > 0 && rem < d); const uint64_t e = d - rem; - + /* This power works if e < 2**floor_log_2_d. */ if (e < (1ULL << floor_log_2_d)) { /* This power works */ @@ -702,30 +702,30 @@ uint64_t libdivide_u64_do(uint64_t numer, const struct libdivide_u64_t *denom) { } } - + int libdivide_u64_get_algorithm(const struct libdivide_u64_t *denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U64_SHIFT_PATH) return 0; else if (! (more & LIBDIVIDE_ADD_MARKER)) return 1; else return 2; } - + uint64_t libdivide_u64_do_alg0(uint64_t numer, const struct libdivide_u64_t *denom) { - return numer >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); + return numer >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); } - + uint64_t libdivide_u64_do_alg1(uint64_t numer, const struct libdivide_u64_t *denom) { uint64_t q = libdivide__mullhi_u64(denom->magic, numer); return q >> denom->more; } - + uint64_t libdivide_u64_do_alg2(uint64_t numer, const struct libdivide_u64_t *denom) { uint64_t q = libdivide__mullhi_u64(denom->magic, numer); uint64_t t = ((numer - q) >> 1) + q; return t >> (denom->more & LIBDIVIDE_64_SHIFT_MASK); } - -#if LIBDIVIDE_USE_SSE2 + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_u64_do_vector(__m128i numers, const struct libdivide_u64_t * denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_U64_SHIFT_PATH) { @@ -761,11 +761,11 @@ __m128i libdivide_u64_do_vector_alg2(__m128i numers, const struct libdivide_u64_ return _mm_srl_epi64(t, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_64_SHIFT_MASK)); } - + #endif - + /////////// SINT32 - + static inline int32_t libdivide__mullhi_s32(int32_t x, int32_t y) { int64_t xl = x, yl = y; @@ -775,7 +775,7 @@ static inline int32_t libdivide__mullhi_s32(int32_t x, int32_t y) { struct libdivide_s32_t libdivide_s32_gen(int32_t d) { struct libdivide_s32_t result; - + /* If d is a power of 2, or negative a power of 2, we have to use a shift. This is especially important because the magic algorithm fails for -1. To check if d is a power of 2 or its inverse, it suffices to check whether its absolute value has exactly one bit set. This works even for INT_MIN, because abs(INT_MIN) == INT_MIN, and INT_MIN has one bit set and is a power of 2. */ uint32_t absD = (uint32_t)(d < 0 ? -d : d); //gcc optimizes this to the fast abs trick if ((absD & (absD - 1)) == 0) { //check if exactly one bit is set, don't care if absD is 0 since that's divide by zero @@ -784,14 +784,14 @@ struct libdivide_s32_t libdivide_s32_gen(int32_t d) { } else { const uint32_t floor_log_2_d = 31 - libdivide__count_leading_zeros32(absD); - LIBDIVIDE_ASSERT(floor_log_2_d >= 1); - + LIBDIVIDE_ASSERT(floor_log_2_d >= 1); + uint8_t more; //the dividend here is 2**(floor_log_2_d + 31), so the low 32 bit word is 0 and the high word is floor_log_2_d - 1 uint32_t rem, proposed_m; proposed_m = libdivide_64_div_32_to_32(1U << (floor_log_2_d - 1), 0, absD, &rem); const uint32_t e = absD - rem; - + /* We are going to start with a power of floor_log_2_d - 1. This works if works if e < 2**floor_log_2_d. */ if (e < (1U << floor_log_2_d)) { /* This power works */ @@ -807,7 +807,7 @@ struct libdivide_s32_t libdivide_s32_gen(int32_t d) { proposed_m += 1; result.magic = (d < 0 ? -(int32_t)proposed_m : (int32_t)proposed_m); result.more = more; - + } return result; } @@ -832,57 +832,57 @@ int32_t libdivide_s32_do(int32_t numer, const struct libdivide_s32_t *denom) { q += (q < 0); return q; } -} - +} + int libdivide_s32_get_algorithm(const struct libdivide_s32_t *denom) { uint8_t more = denom->more; int positiveDivisor = ! (more & LIBDIVIDE_NEGATIVE_DIVISOR); if (more & LIBDIVIDE_S32_SHIFT_PATH) return (positiveDivisor ? 0 : 1); - else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); + else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); else return 4; } - + int32_t libdivide_s32_do_alg0(int32_t numer, const struct libdivide_s32_t *denom) { uint8_t shifter = denom->more & LIBDIVIDE_32_SHIFT_MASK; int32_t q = numer + ((numer >> 31) & ((1 << shifter) - 1)); return q >> shifter; } - + int32_t libdivide_s32_do_alg1(int32_t numer, const struct libdivide_s32_t *denom) { uint8_t shifter = denom->more & LIBDIVIDE_32_SHIFT_MASK; int32_t q = numer + ((numer >> 31) & ((1 << shifter) - 1)); return - (q >> shifter); } - + int32_t libdivide_s32_do_alg2(int32_t numer, const struct libdivide_s32_t *denom) { int32_t q = libdivide__mullhi_s32(denom->magic, numer); q += numer; q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } - + int32_t libdivide_s32_do_alg3(int32_t numer, const struct libdivide_s32_t *denom) { int32_t q = libdivide__mullhi_s32(denom->magic, numer); q -= numer; q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); - return q; -} - -int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom) { - int32_t q = libdivide__mullhi_s32(denom->magic, numer); - q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } -#if LIBDIVIDE_USE_SSE2 +int32_t libdivide_s32_do_alg4(int32_t numer, const struct libdivide_s32_t *denom) { + int32_t q = libdivide__mullhi_s32(denom->magic, numer); + q >>= denom->more & LIBDIVIDE_32_SHIFT_MASK; + q += (q < 0); + return q; +} + +#if LIBDIVIDE_USE_SSE2 __m128i libdivide_s32_do_vector(__m128i numers, const struct libdivide_s32_t * denom) { uint8_t more = denom->more; if (more & LIBDIVIDE_S32_SHIFT_PATH) { uint32_t shifter = more & LIBDIVIDE_32_SHIFT_MASK; - __m128i roundToZeroTweak = _mm_set1_epi32((1 << shifter) - 1); //could use _mm_srli_epi32 with an all -1 register + __m128i roundToZeroTweak = _mm_set1_epi32((1 << shifter) - 1); //could use _mm_srli_epi32 with an all -1 register __m128i q = _mm_add_epi32(numers, _mm_and_si128(_mm_srai_epi32(numers, 31), roundToZeroTweak)); //q = numer + ((numer >> 31) & roundToZeroTweak); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(shifter)); // q = q >> shifter __m128i shiftMask = _mm_set1_epi32((int32_t)((int8_t)more >> 7)); //set all bits of shift mask = to the sign bit of more @@ -893,7 +893,7 @@ __m128i libdivide_s32_do_vector(__m128i numers, const struct libdivide_s32_t * d __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); if (more & LIBDIVIDE_ADD_MARKER) { __m128i sign = _mm_set1_epi32((int32_t)(int8_t)more >> 7); //must be arithmetic shift - q = _mm_add_epi32(q, _mm_sub_epi32(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); + q = _mm_add_epi32(q, _mm_sub_epi32(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); } q = _mm_sra_epi32(q, libdivide_u32_to_m128i(more & LIBDIVIDE_32_SHIFT_MASK)); //q >>= shift q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); // q += (q < 0) @@ -919,7 +919,7 @@ __m128i libdivide_s32_do_vector_alg2(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_add_epi32(q, numers); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_32_SHIFT_MASK)); - q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); + q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); return q; } @@ -927,7 +927,7 @@ __m128i libdivide_s32_do_vector_alg3(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_sub_epi32(q, numers); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more & LIBDIVIDE_32_SHIFT_MASK)); - q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); + q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); return q; } @@ -935,16 +935,16 @@ __m128i libdivide_s32_do_vector_alg4(__m128i numers, const struct libdivide_s32_ __m128i q = libdivide_mullhi_s32_flat_vector(numers, _mm_set1_epi32(denom->magic)); q = _mm_sra_epi32(q, libdivide_u32_to_m128i(denom->more)); //q >>= shift q = _mm_add_epi32(q, _mm_srli_epi32(q, 31)); // q += (q < 0) - return q; + return q; } #endif - + ///////////// SINT64 - + struct libdivide_s64_t libdivide_s64_gen(int64_t d) { struct libdivide_s64_t result; - + /* If d is a power of 2, or negative a power of 2, we have to use a shift. This is especially important because the magic algorithm fails for -1. To check if d is a power of 2 or its inverse, it suffices to check whether its absolute value has exactly one bit set. This works even for INT_MIN, because abs(INT_MIN) == INT_MIN, and INT_MIN has one bit set and is a power of 2. */ const uint64_t absD = (uint64_t)(d < 0 ? -d : d); //gcc optimizes this to the fast abs trick if ((absD & (absD - 1)) == 0) { //check if exactly one bit is set, don't care if absD is 0 since that's divide by zero @@ -952,14 +952,14 @@ struct libdivide_s64_t libdivide_s64_gen(int64_t d) { result.magic = 0; } else { - const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(absD); - + const uint32_t floor_log_2_d = 63 - libdivide__count_leading_zeros64(absD); + //the dividend here is 2**(floor_log_2_d + 63), so the low 64 bit word is 0 and the high word is floor_log_2_d - 1 uint8_t more; uint64_t rem, proposed_m; proposed_m = libdivide_128_div_64_to_64(1ULL << (floor_log_2_d - 1), 0, absD, &rem); const uint64_t e = absD - rem; - + /* We are going to start with a power of floor_log_2_d - 1. This works if works if e < 2**floor_log_2_d. */ if (e < (1ULL << floor_log_2_d)) { /* This power works */ @@ -1000,9 +1000,9 @@ int64_t libdivide_s64_do(int64_t numer, const struct libdivide_s64_t *denom) { q += (q < 0); return q; } -} - - +} + + int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom) { uint8_t more = denom->more; int positiveDivisor = ! (more & LIBDIVIDE_NEGATIVE_DIVISOR); @@ -1010,20 +1010,20 @@ int libdivide_s64_get_algorithm(const struct libdivide_s64_t *denom) { else if (more & LIBDIVIDE_ADD_MARKER) return (positiveDivisor ? 2 : 3); else return 4; } - + int64_t libdivide_s64_do_alg0(int64_t numer, const struct libdivide_s64_t *denom) { uint32_t shifter = denom->more & LIBDIVIDE_64_SHIFT_MASK; int64_t q = numer + ((numer >> 63) & ((1LL << shifter) - 1)); - return q >> shifter; + return q >> shifter; } - + int64_t libdivide_s64_do_alg1(int64_t numer, const struct libdivide_s64_t *denom) { //denom->shifter != -1 && demo->shiftMask != 0 uint32_t shifter = denom->more & LIBDIVIDE_64_SHIFT_MASK; int64_t q = numer + ((numer >> 63) & ((1LL << shifter) - 1)); return - (q >> shifter); } - + int64_t libdivide_s64_do_alg2(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q += numer; @@ -1031,20 +1031,20 @@ int64_t libdivide_s64_do_alg2(int64_t numer, const struct libdivide_s64_t *denom q += (q < 0); return q; } - + int64_t libdivide_s64_do_alg3(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q -= numer; q >>= denom->more & LIBDIVIDE_64_SHIFT_MASK; - q += (q < 0); + q += (q < 0); return q; } - + int64_t libdivide_s64_do_alg4(int64_t numer, const struct libdivide_s64_t *denom) { int64_t q = libdivide__mullhi_s64(denom->magic, numer); q >>= denom->more; q += (q < 0); - return q; + return q; } @@ -1065,7 +1065,7 @@ __m128i libdivide_s64_do_vector(__m128i numers, const struct libdivide_s64_t * d __m128i q = libdivide_mullhi_s64_flat_vector(numers, libdivide__u64_to_m128(magic)); if (more & LIBDIVIDE_ADD_MARKER) { __m128i sign = _mm_set1_epi32((int32_t)((int8_t)more >> 7)); //must be arithmetic shift - q = _mm_add_epi64(q, _mm_sub_epi64(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); + q = _mm_add_epi64(q, _mm_sub_epi64(_mm_xor_si128(numers, sign), sign)); // q += ((numer ^ sign) - sign); } q = libdivide_s64_shift_right_vector(q, more & LIBDIVIDE_64_SHIFT_MASK); //q >>= denom->mult_path.shift q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); // q += (q < 0) @@ -1102,20 +1102,20 @@ __m128i libdivide_s64_do_vector_alg3(__m128i numers, const struct libdivide_s64_ q = _mm_sub_epi64(q, numers); q = libdivide_s64_shift_right_vector(q, denom->more & LIBDIVIDE_64_SHIFT_MASK); q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); // q += (q < 0) - return q; + return q; } __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_t *denom) { __m128i q = libdivide_mullhi_s64_flat_vector(numers, libdivide__u64_to_m128(denom->magic)); q = libdivide_s64_shift_right_vector(q, denom->more); q = _mm_add_epi64(q, _mm_srli_epi64(q, 63)); - return q; + return q; } #endif - + /////////// C++ stuff - + #ifdef __cplusplus /* The C++ template design here is a total mess. This needs to be fixed by someone better at templates than I. The current design is: @@ -1131,7 +1131,7 @@ __m128i libdivide_s64_do_vector_alg4(__m128i numers, const struct libdivide_s64_ */ namespace libdivide_internal { - + #if LIBDIVIDE_USE_SSE2 #define MAYBE_VECTOR(x) x #define MAYBE_VECTOR_PARAM __m128i vector_func(__m128i, const DenomType *) @@ -1149,12 +1149,12 @@ namespace libdivide_internal { #endif template - class divider_base { + class divider_base { public: DenomType denom; divider_base(IntType d) : denom(gen_func(d)) { } divider_base(const DenomType & d) : denom(d) { } - + IntType perform_divide(IntType val) const { return do_func(val, &denom); } #if LIBDIVIDE_USE_SSE2 __m128i perform_divide_vector(__m128i val) const { return vector_func(val, &denom); } @@ -1162,37 +1162,37 @@ namespace libdivide_internal { int get_algorithm() const { return get_algo(&denom); } }; - - + + template struct divider_mid { }; - + template<> struct divider_mid { typedef uint32_t IntType; typedef struct libdivide_u32_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; template struct algo<1, J> { typedef denom::divider divider; }; template struct algo<2, J> { typedef denom::divider divider; }; - - /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ + + /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; }; - + template<> struct divider_mid { typedef int32_t IntType; typedef struct libdivide_s32_t DenomType; template struct denom { typedef divider_base divider; }; - - + + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; @@ -1200,36 +1200,36 @@ namespace libdivide_internal { template struct algo<2, J> { typedef denom::divider divider; }; template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; - + }; - + template<> struct divider_mid { typedef uint64_t IntType; typedef struct libdivide_u64_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; template struct algo<1, J> { typedef denom::divider divider; }; template struct algo<2, J> { typedef denom::divider divider; }; - + /* Define two more bogus ones so that the same (templated, presumably) code can handle both signed and unsigned */ template struct algo<3, J> { typedef denom::divider divider; }; template struct algo<4, J> { typedef denom::divider divider; }; }; - + template<> struct divider_mid { typedef int64_t IntType; typedef struct libdivide_s64_t DenomType; template struct denom { typedef divider_base divider; }; - + template struct algo { }; template struct algo<-1, J> { typedef denom::divider divider; }; template struct algo<0, J> { typedef denom::divider divider; }; @@ -1248,29 +1248,29 @@ class divider typename libdivide_internal::divider_mid::template algo::divider sub; template friend divider unswitch(const divider & d); divider(const typename libdivide_internal::divider_mid::DenomType & denom) : sub(denom) { } - + public: - + /* Ordinary constructor, that takes the divisor as a parameter. */ divider(T n) : sub(n) { } - + /* Default constructor, that divides by 1 */ divider() : sub(1) { } - + /* Divides the parameter by the divisor, returning the quotient */ T perform_divide(T val) const { return sub.perform_divide(val); } - + #if LIBDIVIDE_USE_SSE2 /* Treats the vector as either two or four packed values (depending on the size), and divides each of them by the divisor, returning the packed quotients. */ - __m128i perform_divide_vector(__m128i val) const { return sub.perform_divide_vector(val); } + __m128i perform_divide_vector(__m128i val) const { return sub.perform_divide_vector(val); } #endif /* Returns the index of algorithm, for use in the unswitch function */ int get_algorithm() const { return sub.get_algorithm(); } // returns the algorithm for unswitching - + /* operator== */ bool operator==(const divider & him) const { return sub.denom.magic == him.sub.denom.magic && sub.denom.more == him.sub.denom.more; } - + bool operator!=(const divider & him) const { return ! (*this == him); } }; @@ -1291,10 +1291,10 @@ __m128i operator/(__m128i numer, const divider & denom) { return denom.perform_divide_vector(numer); } #endif - - + + #endif //__cplusplus - + #endif //LIBDIVIDE_HEADER_ONLY #ifdef __cplusplus } //close namespace libdivide diff --git a/Minecraft.Client/PSVita/PSVitaExtras/zconf.h b/Minecraft.Client/PSVita/PSVitaExtras/zconf.h index 48405ca0..981886db 100644 --- a/Minecraft.Client/PSVita/PSVitaExtras/zconf.h +++ b/Minecraft.Client/PSVita/PSVitaExtras/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 __int64 +# define z_off64_t int64_t # else # define z_off64_t z_off_t # endif diff --git a/Minecraft.Client/PSVita/PSVita_App.cpp b/Minecraft.Client/PSVita/PSVita_App.cpp index a21699c0..6cba116d 100644 --- a/Minecraft.Client/PSVita/PSVita_App.cpp +++ b/Minecraft.Client/PSVita/PSVita_App.cpp @@ -307,7 +307,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() wstring wWorldName = L"TestWorld"; bool isFlat = false; - __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 + 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 NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; @@ -320,7 +320,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() app.SetGameHostOption(eGameHostOption_Gamertags,1); app.SetGameHostOption(eGameHostOption_BedrockFog,1); - app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId()); + app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId()); app.SetGameHostOption(eGameHostOption_LevelType, 0 ); app.SetGameHostOption(eGameHostOption_Structures, 1 ); app.SetGameHostOption(eGameHostOption_BonusChest, 0 ); @@ -391,7 +391,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_GetProductList: - { + { m_eCommerce_State=eCommerce_State_GetProductList_Pending; SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); std::list::iterator iter = pCategories->subCategories.begin(); @@ -407,7 +407,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_AddProductInfoDetailed: - { + { m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending; // for each of the products in the categories, get the detailed info. We really only need the long description and price info. @@ -444,7 +444,7 @@ void CConsoleMinecraftApp::CommerceTick() break; case eCommerce_State_RegisterDLC: - { + { m_eCommerce_State=eCommerce_State_Online; // register the DLC info SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo(); @@ -531,20 +531,20 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo() return &m_CategoryInfo; } -#endif +#endif void CConsoleMinecraftApp::ClearCommerceDetails() { #ifdef VITA_COMMERCE_ENABLED for(int i=0;i* pProductList=&m_ProductListA[i]; + std::vector* pProductList=&m_ProductListA[i]; pProductList->clear(); } if(m_ProductListA!=NULL) { - delete [] m_ProductListA; + delete [] m_ProductListA; m_ProductListA=NULL; } @@ -580,11 +580,11 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchDLCProductID,Info.productId)==0) - { + { memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN); return; } - } + } } } return; @@ -607,18 +607,18 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID) { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchSkuID,Info.skuId)==0) - { + { productInfo = &(*it); break; } - } + } } } if(productInfo) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,productInfo->skuId); m_pCheckoutProductInfo = productInfo; m_eCommerce_State=eCommerce_State_Checkout; @@ -633,7 +633,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID) void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) { if(m_eCommerce_State==eCommerce_State_Online) - { + { strcpy(m_pchSkuID,pchSkuID); m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased; } @@ -642,7 +642,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID) bool CConsoleMinecraftApp::UpgradeTrial() { if(m_eCommerce_State==eCommerce_State_Online) - { + { m_eCommerce_State=eCommerce_State_UpgradeTrial; return true; } @@ -687,7 +687,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) { SonyCommerce::ProductInfo Info=*it; if(strcmp(pchTitle,Info.skuId)==0) - { + { if(Info.purchasabilityFlag==SCE_TOOLKIT_NP_COMMERCE_NOT_PURCHASED) { return false; @@ -697,7 +697,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle) return true; } } - } + } } } #endif //#ifdef VITA_COMMERCE_ENABLED @@ -734,7 +734,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err) if(err==0) { pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories; - // allocate the memory for the product info for each categories + // allocate the memory for the product info for each categories if(pClass->m_CategoryInfo.countOfSubCategories>0) { pClass->m_ProductListA = (std::vector *) new std::vector [pClass->m_CategoryInfo.countOfSubCategories]; @@ -768,7 +768,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err { // we're done, so now retrieve the additional product details for each product pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } else { @@ -778,21 +778,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bCommerceProductListRetrieved=true; + pClass->m_bCommerceProductListRetrieved=true; } } // void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err) // { // CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam; -// +// // if(err==0) // { // pScene->m_eCommerce_State=eCommerce_State_Idle; -// //pScene->m_bCommerceProductListRetrieved=true; +// //pScene->m_bCommerceProductListRetrieved=true; // } // //printf("Callback hit, error 0x%08x\n", err); -// +// // } void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err) @@ -812,7 +812,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // MGH - change this to a while loop so we can skip empty categories. do - { + { pClass->m_iCurrentCategory++; }while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategorym_ProductListCategoriesC); @@ -821,12 +821,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam { // there are no more categories, so we're done pClass->m_eCommerce_State=eCommerce_State_RegisterDLC; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; } else { // continue with the next category - pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; + pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed; } } else @@ -838,7 +838,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam else { pClass->m_eCommerce_State=eCommerce_State_Error; - pClass->m_bProductListAdditionalDetailsRetrieved=true; + pClass->m_bProductListAdditionalDetailsRetrieved=true; pClass->m_iCurrentProduct=0; pClass->m_iCurrentCategory=0; } @@ -1109,7 +1109,7 @@ void printSaveState() case C4JStorage::ESaveGame_SaveCache: strState = "ESaveGame_SaveCache"; break; case C4JStorage::ESaveGame_ReconstructCache: strState = "ESaveGame_ReconstructCache"; break; } - + app.DebugPrintf("[printSaveState] GetSaveState == %s.\n", strState.c_str()); #endif } @@ -1156,7 +1156,7 @@ void CConsoleMinecraftApp::SaveDataTick() { app.DebugPrintf("[SaveDataTick] eSaveDataDeleteState_abort.\n"); StorageManager.CancelIncompleteOperation(); - } + } else if (m_bSaveDataDeleteDialogState == eSaveDataDeleteState_continue) { app.DebugPrintf("[SaveDataTick] eSaveDataDeleteState_continue.\n"); @@ -1228,7 +1228,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage: int CConsoleMinecraftApp::NoSaveSpaceReturned(void *pParam,int iPad,C4JStorage::EMessageResult result) { - if(result==C4JStorage::EMessage_ResultAccept) + if(result==C4JStorage::EMessage_ResultAccept) { int blocksRequired = (int)pParam; if(blocksRequired > 0) @@ -1256,7 +1256,7 @@ int CConsoleMinecraftApp::cbConfirmDeleteMessageBox(void *pParam, int iPad, cons if (pClass != NULL && pClass->m_pSaveToDelete != NULL) { - if (result == C4JStorage::EMessage_ResultDecline) + if (result == C4JStorage::EMessage_ResultDecline) { pClass->m_bSaveDataDeleteDialogState = eSaveDataDeleteState_deleting; C4JStorage::ESaveGameState eDeleteStatus = StorageManager.DeleteSaveData(pClass->m_pSaveToDelete, cbSaveDataDeleted, pClass); @@ -1290,7 +1290,7 @@ void CConsoleMinecraftApp::initSaveIncompleteDialog(int spaceNeeded) param.sysMsgParam->sysMsgType = SCE_SAVEDATA_DIALOG_SYSMSG_TYPE_NOSPACE_CONTINUABLE; param.sysMsgParam->value = (SceInt32) spaceNeeded; - + SceInt32 ret = sceSaveDataDialogInit(¶m); if (ret == SCE_OK) { @@ -1376,13 +1376,13 @@ void CConsoleMinecraftApp::initSaveDataDeleteDialog() // Start getting saves data to use when deleting. if (StorageManager.ReturnSavesInfo() == NULL) { - C4JStorage::ESaveGameState eSGIStatus - = StorageManager.GetSavesInfo( + C4JStorage::ESaveGameState eSGIStatus + = StorageManager.GetSavesInfo( ProfileManager.GetPrimaryPad(), - NULL, - this, + NULL, + this, "save" - ); + ); } // Dim background because sony doesn't do that. @@ -1414,7 +1414,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog() { SceSaveDataDialogResult dialogResult; ZeroMemory(&dialogResult, sizeof(SceSaveDataDialogResult)); - + SceInt32 ret = sceSaveDataDialogGetResult(&dialogResult); if (ret == SCE_OK) { @@ -1438,7 +1438,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog() { SceAppUtilSaveDataSlotParam slotParam; ret = sceAppUtilSaveDataSlotGetParam( dialogResult.slotId, &slotParam, NULL ); - + if (ret == SCE_OK) { int saveindex = -1; @@ -1469,12 +1469,12 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog() { app.DebugPrintf("[SaveDataDeleteDialog] ERROR: PERFORMING DELETE OPERATION, pSavesDetails is null.\n"); } - + if (pSaveInfo != NULL) { app.DebugPrintf( "[SaveDataDeleteDialog] User wishes to delete slot_%d:\n\t" - "4jsaveindex=%d, filename='%s', title='%s', subtitle='%s', size=%dKiB.\n", + "4jsaveindex=%d, filename='%s', title='%s', subtitle='%s', size=%dKiB.\n", dialogResult.slotId, saveindex, pSaveInfo->UTF8SaveFilename, @@ -1490,7 +1490,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog() }; ui.RequestMessageBox( - IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, + IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE, uiIDA, 2, 0, &cbConfirmDeleteMessageBox, this, @@ -1498,7 +1498,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog() ); m_bSaveDataDeleteDialogState = eSaveDataDeleteState_userConfirmation; - + m_pSaveToDelete = pSaveInfo; } else @@ -1571,7 +1571,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam * { SceAppUtilSaveDataSlotParam slotParam; int ret = sceAppUtilSaveDataSlotGetParam( i, &slotParam, NULL ); - + if (ret == SCE_OK) { SceAppUtilSaveDataSlot slot; @@ -1584,7 +1584,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam * slots.push_back( slot ); } } - + SceAppUtilSaveDataSlot *pSavesList = new SceAppUtilSaveDataSlot[slots.size()]; int slotIndex = 0; @@ -1618,7 +1618,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam * listParam.listTitle = (const SceChar8 *) strPtr; listParam.itemStyle = SCE_SAVEDATA_DIALOG_LIST_ITEM_STYLE_TITLE_SUBTITLE_DATE; - + baseParam->mode = SCE_SAVEDATA_DIALOG_MODE_LIST; baseParam->dispType = SCE_SAVEDATA_DIALOG_TYPE_DELETE; baseParam->listParam = &listParam; @@ -1659,10 +1659,10 @@ int CConsoleMinecraftApp::cbSaveDataDeleted( void *pParam, const bool success ) void CConsoleMinecraftApp::finishedDeletingSaves(bool bContinue) { app.DebugPrintf( "[finishedDeletingSaves] %s.\n", (bContinue?"Continuing":"Aborting") ); - + StorageManager.SetSaveDisabled(false); LeaveSaveNotificationSection(); - + StorageManager.ClearSaveError(); StorageManager.ClearOptionsSaveError(); diff --git a/Minecraft.Client/PlayerChunkMap.cpp b/Minecraft.Client/PlayerChunkMap.cpp index aedd5a9d..1c7516cf 100644 --- a/Minecraft.Client/PlayerChunkMap.cpp +++ b/Minecraft.Client/PlayerChunkMap.cpp @@ -54,7 +54,7 @@ void PlayerChunkMap::PlayerChunk::add(shared_ptr player, bool send //app.DebugPrintf("--- Adding player to chunk x=%d\tz=%d\n",x, z); if (find(players.begin(),players.end(),player) != players.end()) { - // 4J-PB - At the start of the game, lots of chunks are added, and we can then move into an area that is outside the diameter of our starting area, + // 4J-PB - At the start of the game, lots of chunks are added, and we can then move into an area that is outside the diameter of our starting area, // but is inside the area loaded at the start. app.DebugPrintf("--- Adding player to chunk x=%d\t z=%d, but they are already in there!\n",pos.x, pos.z); return; @@ -69,7 +69,7 @@ void PlayerChunkMap::PlayerChunk::add(shared_ptr player, bool send if( sendPacket ) player->connection->send( shared_ptr( new ChunkVisibilityPacket(pos.x, pos.z, true) ) ); players.push_back(player); - + player->chunksToSend.push_back(pos); #ifdef _LARGE_WORLDS @@ -93,7 +93,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) players.erase(it); if (players.size() == 0) { - __int64 id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); + int64_t id = (pos.x + 0x7fffffffLL) | ((pos.z + 0x7fffffffLL) << 32); AUTO_VAR(it, parent->chunks.find(id)); if( it != parent->chunks.end() ) { @@ -116,7 +116,7 @@ void PlayerChunkMap::PlayerChunk::remove(shared_ptr player) { INetworkPlayer *thisNetPlayer = player->connection->getNetworkPlayer(); bool noOtherPlayersFound = true; - + if( thisNetPlayer != NULL ) { for( AUTO_VAR(it, players.begin()); it < players.end(); ++it ) @@ -203,7 +203,7 @@ void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) } else { - for(unsigned int j = 0; j < sentTo.size(); j++ ) + for(unsigned int j = 0; j < sentTo.size(); j++ ) { shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); @@ -265,7 +265,7 @@ void PlayerChunkMap::PlayerChunk::broadcast(shared_ptr packet) } else { - for(unsigned int j = 0; j < sentTo.size(); j++ ) + for(unsigned int j = 0; j < sentTo.size(); j++ ) { shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); @@ -327,7 +327,7 @@ bool PlayerChunkMap::PlayerChunk::broadcastChanges(bool allowRegionUpdate) // Fix for buf #95007 : TCR #001 BAS Game Stability: TU12: Code: Compliance: More than 192 dropped items causes game to freeze or crash. // Block region update packets can only encode ys in a range of 1 - 256 - if( ys > 256 ) ys = 256; + if( ys > 256 ) ys = 256; broadcast( shared_ptr( new BlockRegionUpdatePacket(xp, yp, zp, xs, ys, zs, level) ) ); vector > *tes = level->getTileEntitiesInRegion(xp, yp, zp, xp + xs, yp + ys, zp + zs); @@ -433,13 +433,13 @@ void PlayerChunkMap::tick() bool PlayerChunkMap::hasChunk(int x, int z) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); return chunks.find(id) != chunks.end(); } PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); AUTO_VAR(it, chunks.find(id)); PlayerChunk *chunk = NULL; @@ -460,7 +460,7 @@ PlayerChunkMap::PlayerChunk *PlayerChunkMap::getChunk(int x, int z, bool create) // queue a request for it to be created. void PlayerChunkMap::getChunkAndAddPlayer(int x, int z, shared_ptr player) { - __int64 id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); + int64_t id = (x + 0x7fffffffLL) | ((z + 0x7fffffffLL) << 32); AUTO_VAR(it, chunks.find(id)); if( it != chunks.end() ) @@ -487,7 +487,7 @@ void PlayerChunkMap::getChunkAndRemovePlayer(int x, int z, shared_ptr player) int px = (int)player->x; int pz = (int)player->z; int minDistSq = -1; - + AUTO_VAR(itNearest, addRequests.end()); for( AUTO_VAR(it, addRequests.begin()); it != addRequests.end(); it++ ) { @@ -721,7 +721,7 @@ void PlayerChunkMap::move(shared_ptr player) for (int x = xc - radius; x <= xc + radius; x++) for (int z = zc - radius; z <= zc + radius; z++) - { + { if (!chunkInRange(x, z, last_xc, last_zc)) { // 4J - changed from separate getChunk & add so we can wrap these operations up and queue @@ -783,7 +783,7 @@ void PlayerChunkMap::setRadius(int newRadius) for (int x = xc - newRadius; x <= xc + newRadius; x++) for (int z = zc - newRadius; z <= zc + newRadius; z++) - { + { // check if this chunk is outside the old radius area if ( x < xc - radius || x > xc + radius || z < zc - radius || z > zc + radius ) { diff --git a/Minecraft.Client/PlayerChunkMap.h b/Minecraft.Client/PlayerChunkMap.h index 61324272..08cda2a7 100644 --- a/Minecraft.Client/PlayerChunkMap.h +++ b/Minecraft.Client/PlayerChunkMap.h @@ -66,7 +66,7 @@ public: vector > players; void flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFound); // 4J added private: - unordered_map<__int64,PlayerChunk *,LongKeyHash,LongKeyEq> chunks; // 4J - was LongHashMap + unordered_map chunks; // 4J - was LongHashMap vector changedChunks; vector addRequests; // 4J added void tickAddRequests(shared_ptr player); // 4J added diff --git a/Minecraft.Client/PlayerConnection.h b/Minecraft.Client/PlayerConnection.h index 0d4ce2f6..d7b56a83 100644 --- a/Minecraft.Client/PlayerConnection.h +++ b/Minecraft.Client/PlayerConnection.h @@ -30,9 +30,9 @@ private: bool didTick; int lastKeepAliveId; - __int64 lastKeepAliveTime; + int64_t lastKeepAliveTime; static Random random; - __int64 lastKeepAliveTick; + int64_t lastKeepAliveTick; int chatSpamTickCount; int dropSpamTickCount; @@ -81,7 +81,7 @@ private: public: // 4J Stu - Handlers only valid in debug mode -#ifndef _CONTENT_PACKAGE +#ifndef _CONTENT_PACKAGE virtual void handleContainerSetSlot(shared_ptr packet); #endif virtual void handleContainerClick(shared_ptr packet); @@ -89,13 +89,13 @@ public: virtual void handleSetCreativeModeSlot(shared_ptr packet); virtual void handleContainerAck(shared_ptr packet); virtual void handleSignUpdate(shared_ptr packet); - virtual void handleKeepAlive(shared_ptr packet); + virtual void handleKeepAlive(shared_ptr packet); virtual void handlePlayerInfo(shared_ptr packet); // 4J Added virtual bool isServerPacketListener(); virtual void handlePlayerAbilities(shared_ptr playerAbilitiesPacket); virtual void handleCustomPayload(shared_ptr customPayloadPacket); - // 4J Added + // 4J Added virtual void handleCraftItem(shared_ptr packet); virtual void handleTradeItem(shared_ptr packet); virtual void handleDebugOptions(shared_ptr packet); diff --git a/Minecraft.Client/ProgressRenderer.cpp b/Minecraft.Client/ProgressRenderer.cpp index a7c3fd30..575a4510 100644 --- a/Minecraft.Client/ProgressRenderer.cpp +++ b/Minecraft.Client/ProgressRenderer.cpp @@ -24,7 +24,7 @@ void ProgressRenderer::progressStart(int title) void ProgressRenderer::progressStartNoAbort(int string) { - noAbort = true; + noAbort = true; _progressStart(string); } @@ -36,7 +36,7 @@ void ProgressRenderer::_progressStart(int title) if (noAbort) return; // throw new StopGameException(); // 4J - removed } - + EnterCriticalSection( &ProgressRenderer::s_progress ); lastPercent = 0; this->title = title; @@ -88,7 +88,7 @@ void ProgressRenderer::progressStagePercentage(int i) } - __int64 now = System::currentTimeMillis(); + int64_t now = System::currentTimeMillis(); if (now - lastTime < 20) return; lastTime = now; diff --git a/Minecraft.Client/ProgressRenderer.h b/Minecraft.Client/ProgressRenderer.h index 29c847d0..a66c73fb 100644 --- a/Minecraft.Client/ProgressRenderer.h +++ b/Minecraft.Client/ProgressRenderer.h @@ -25,7 +25,7 @@ private: int status; Minecraft *minecraft; int title; - __int64 lastTime; + int64_t lastTime; bool noAbort; wstring m_wstrText; eProgressStringType m_eType; diff --git a/Minecraft.Client/ScrolledSelectionList.h b/Minecraft.Client/ScrolledSelectionList.h index 77ec1fd8..0fc38e50 100644 --- a/Minecraft.Client/ScrolledSelectionList.h +++ b/Minecraft.Client/ScrolledSelectionList.h @@ -28,7 +28,7 @@ private: float yo; int lastSelection; - __int64 lastSelectionTime ; + int64_t lastSelectionTime ; bool renderSelection; bool _renderHeader; @@ -40,7 +40,7 @@ public: protected: void setRenderHeader(bool renderHeader, int headerHeight); - virtual int getNumberOfItems() = 0; + virtual int getNumberOfItems() = 0; virtual void selectItem(int item, bool doubleClick) = 0; virtual bool isSelectedItem(int item) = 0; virtual int getMaxPosition(); diff --git a/Minecraft.Client/SelectWorldScreen.cpp b/Minecraft.Client/SelectWorldScreen.cpp index a07eb7b2..068d9b6c 100644 --- a/Minecraft.Client/SelectWorldScreen.cpp +++ b/Minecraft.Client/SelectWorldScreen.cpp @@ -246,7 +246,7 @@ void SelectWorldScreen::WorldSelectionList::selectItem(int item, bool doubleClic parent->deleteButton->active = active; parent->renameButton->active = active; - if (doubleClick && active) + if (doubleClick && active) { parent->worldSelected(item); } @@ -294,7 +294,7 @@ void SelectWorldScreen::WorldSelectionList::renderItem(int i, int x, int y, int swprintf(buffer,20,L"%d/%d/%d %d:%02d",time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute); // 4J - TODO Localise this id = id + L" (" + buffer; - __int64 size = levelSummary->getSizeOnDisk(); + int64_t size = levelSummary->getSizeOnDisk(); id = id + L", " + _toString(size / 1024 * 100 / 1024 / 100.0f) + L" MB)"; wstring info; diff --git a/Minecraft.Client/ServerLevel.cpp b/Minecraft.Client/ServerLevel.cpp index de8c66cd..05566ad8 100644 --- a/Minecraft.Client/ServerLevel.cpp +++ b/Minecraft.Client/ServerLevel.cpp @@ -93,8 +93,8 @@ void ServerLevel::staticCtor() ServerLevel::ServerLevel(MinecraftServer *server, shared_ptrlevelStorage, const wstring& levelName, int dimension, LevelSettings *levelSettings) : Level(levelStorage, levelName, levelSettings, Dimension::getNew(dimension), false) { - InitializeCriticalSection(&m_limiterCS); - InitializeCriticalSection(&m_tickNextTickCS); + InitializeCriticalSection(&m_limiterCS); + InitializeCriticalSection(&m_tickNextTickCS); InitializeCriticalSection(&m_csQueueSendTileUpdates); m_fallingTileCount = 0; m_primedTntCount = 0; @@ -192,7 +192,7 @@ void ServerLevel::tick() if (!somebodyWokeUp) { // skip time until new day - __int64 newTime = levelData->getTime() + TICKS_PER_DAY; + int64_t newTime = levelData->getTime() + TICKS_PER_DAY; // 4J : WESTY : Changed so that time update goes through stats tracking update code. //levelData->setTime(newTime - (newTime % TICKS_PER_DAY)); @@ -222,7 +222,7 @@ void ServerLevel::tick() } } } - + PIXBeginNamedEvent(0,"runTileEvents"); // run after entity updates runTileEvents(); @@ -230,7 +230,7 @@ void ServerLevel::tick() //4J - temporarily disabling saves as they are causing gameplay to generally stutter quite a lot - __int64 time = levelData->getTime() + 1; + int64_t time = levelData->getTime() + 1; // 4J Stu - Putting this back in, but I have reduced the number of chunks that save when not forced #ifdef _LARGE_WORLDS if (time % (saveInterval) == (dimension->id + 1)) @@ -492,7 +492,7 @@ void ServerLevel::tickTiles() { Biome *b = getBiome(x + xo, z + zo); if (b->hasRain()) - { + { int tile = getTile(x + xo, yy - 1, z + zo); if (tile != 0) { @@ -593,7 +593,7 @@ bool ServerLevel::tickPendingTicks(bool force) //throw new IllegalStateException("TickNextTick list out of synch"); } if (count > MAX_TICK_TILES_PER_TICK) count = MAX_TICK_TILES_PER_TICK; - + AUTO_VAR(itTickList, tickNextTickList.begin()); for (int i = 0; i < count; i++) { @@ -783,7 +783,7 @@ void ServerLevel::setInitialSpawn(LevelSettings *levelSettings) zSpawn += random.nextInt(64) - random.nextInt(64); if(zSpawn>maxXZ) zSpawn=0; if(zSpawn chest = dynamic_pointer_cast(getTileEntity(x, y, z)); @@ -861,7 +861,7 @@ void ServerLevel::save(bool force, ProgressListener *progressListener, bool bAut if(StorageManager.GetSaveDisabled()) return; - if (progressListener != NULL) + if (progressListener != NULL) { if(bAutosave) { @@ -871,7 +871,7 @@ void ServerLevel::save(bool force, ProgressListener *progressListener, bool bAut { progressListener->progressStartNoAbort(IDS_PROGRESS_SAVING_LEVEL); } - + } PIXBeginNamedEvent(0,"Saving level data"); saveLevelData(); @@ -931,7 +931,7 @@ void ServerLevel::saveToDisc(ProgressListener *progressListener, bool autosave) DLCPack * pDLCPack=pDLCTexPack->getDLCInfoParentPack(); if(!pDLCPack->hasPurchasedFile( DLCManager::e_DLCType_Texture, L"" )) - { + { return; } } @@ -1032,7 +1032,7 @@ shared_ptr ServerLevel::explode(shared_ptr source, double x, } else { - for(unsigned int j = 0; j < sentTo.size(); j++ ) + for(unsigned int j = 0; j < sentTo.size(); j++ ) { shared_ptr player2 = sentTo[j]; INetworkPlayer *otherPlayer = player2->connection->getNetworkPlayer(); @@ -1139,9 +1139,9 @@ EntityTracker *ServerLevel::getTracker() return tracker; } -void ServerLevel::setTimeAndAdjustTileTicks(__int64 newTime) +void ServerLevel::setTimeAndAdjustTileTicks(int64_t newTime) { - __int64 delta = newTime - levelData->getTime(); + int64_t delta = newTime - levelData->getTime(); // 4J - can't directly adjust m_delay in a set as it has a const interator, since changing values in here might change the ordering of the elements in the set. // Instead move to a vector, do the adjustment, put back in the set. vector temp; @@ -1303,7 +1303,7 @@ void ServerLevel::entityRemovedExtra(shared_ptr e) } // printf("entity removed: item entity count now %d\n",m_itemEntities.size()); LeaveCriticalSection(&m_limiterCS); - } + } else if( dynamic_pointer_cast(e) != NULL ) { EnterCriticalSection(&m_limiterCS); @@ -1316,7 +1316,7 @@ void ServerLevel::entityRemovedExtra(shared_ptr e) } // printf("entity removed: item entity count now %d\n",m_itemEntities.size()); LeaveCriticalSection(&m_limiterCS); - } + } else if( dynamic_pointer_cast(e) != NULL ) { EnterCriticalSection(&m_limiterCS); @@ -1329,7 +1329,7 @@ void ServerLevel::entityRemovedExtra(shared_ptr e) } // printf("entity removed: arrow entity count now %d\n",m_arrowEntities.size()); LeaveCriticalSection(&m_limiterCS); - } + } else if( dynamic_pointer_cast(e) != NULL ) { EnterCriticalSection(&m_limiterCS); @@ -1342,7 +1342,7 @@ void ServerLevel::entityRemovedExtra(shared_ptr e) } // printf("entity removed: experience orb entity count now %d\n",m_arrowEntities.size()); LeaveCriticalSection(&m_limiterCS); - } + } else if( dynamic_pointer_cast(e) != NULL ) { EnterCriticalSection(&m_limiterCS); diff --git a/Minecraft.Client/ServerLevel.h b/Minecraft.Client/ServerLevel.h index 644c15c0..ae413d11 100644 --- a/Minecraft.Client/ServerLevel.h +++ b/Minecraft.Client/ServerLevel.h @@ -114,7 +114,7 @@ protected: public: MinecraftServer *getServer(); EntityTracker *getTracker(); - void setTimeAndAdjustTileTicks(__int64 newTime); + void setTimeAndAdjustTileTicks(int64_t newTime); PlayerChunkMap *getChunkMap(); void queueSendTileUpdate(int x, int y, int z); // 4J Added @@ -142,7 +142,7 @@ public: virtual bool addEntity(shared_ptr e); void entityAddedExtra(shared_ptr e); void entityRemovedExtra(shared_ptr e); - + virtual bool newPrimedTntAllowed(); virtual bool newFallingTileAllowed(); diff --git a/Minecraft.Client/ServerPlayer.cpp b/Minecraft.Client/ServerPlayer.cpp index 489e6f34..eebab435 100644 --- a/Minecraft.Client/ServerPlayer.cpp +++ b/Minecraft.Client/ServerPlayer.cpp @@ -142,7 +142,7 @@ void ServerPlayer::flagEntitiesToBeRemoved(unsigned int *flags, bool *removedFou unsigned int j = index % 32; unsigned int uiMask = 0x80000000 >> j; - flags[i] |= uiMask; + flags[i] |= uiMask; } } } @@ -345,14 +345,14 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) else { bool canSendOnSlowQueue = MinecraftServer::canSendOnSlowQueue(connection->getNetworkPlayer()); - + // app.DebugPrintf("%ls: canSendOnSlowQueue %d, countDelayedPackets %d GetSendQueueSizeBytes %d done: %d", // connection->getNetworkPlayer()->GetUID().toString().c_str(), // canSendOnSlowQueue, connection->countDelayedPackets(), // g_NetworkManager.GetHostPlayer()->GetSendQueueSizeBytes( NULL, true ), // connection->done); - - if( dontDelayChunks || + + if( dontDelayChunks || (canSendOnSlowQueue && (connection->countDelayedPackets() < 4 )&& #ifdef _XBOX_ONE @@ -361,7 +361,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) (g_NetworkManager.GetHostPlayer()->GetSendQueueSizeBytes( NULL, true ) < 8192 )&& #else (g_NetworkManager.GetHostPlayer()->GetSendQueueSizeMessages( NULL, true ) < 4 )&& -#endif +#endif //(tickCount - lastBrupSendTickCount) > (connection->getNetworkPlayer()->GetCurrentRtt()>>4) && !connection->done) ) { @@ -369,9 +369,9 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) okToSend = true; MinecraftServer::s_slowQueuePacketSent = true; -// static unordered_map mapLastTime; -// __int64 thisTime = System::currentTimeMillis(); -// __int64 lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; +// static unordered_map mapLastTime; +// int64_t thisTime = System::currentTimeMillis(); +// int64_t lastTime = mapLastTime[connection->getNetworkPlayer()->GetUID().toString()]; // app.DebugPrintf(" - OK to send (%d ms since last)\n", thisTime - lastTime); // mapLastTime[connection->getNetworkPlayer()->GetUID().toString()] = thisTime; } @@ -445,7 +445,7 @@ void ServerPlayer::doChunkSendingTick(bool dontDelayChunks) for (unsigned int i = 0; i < tes->size(); i++) { // 4J Stu - Added delay param to ensure that these arrive after the BRUPs from above - // Fix for #9169 - ART : Sign text is replaced with the words “Awaiting approval”. + // Fix for #9169 - ART : Sign text is replaced with the words �Awaiting approval�. broadcast(tes->at(i), !connection->isLocal() && !dontDelayChunks); } delete tes; @@ -462,7 +462,7 @@ void ServerPlayer::doTickB(bool ignorePortal) if(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<dimension->id == 0 ) - { + { ignorePortal=false; isInsidePortal=true; portalTime=1; @@ -473,7 +473,7 @@ void ServerPlayer::doTickB(bool ignorePortal) // else if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<dimension->id == 0 ) -// { +// { // server->players->toggleDimension( dynamic_pointer_cast( shared_from_this() ), 1 ); // } // unsigned int uiVal=app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad()); @@ -482,7 +482,7 @@ void ServerPlayer::doTickB(bool ignorePortal) else if (app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<dimension->id != 0 ) - { + { ignorePortal=false; isInsidePortal=true; portalTime=1; @@ -577,7 +577,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) // getEntity returns the owner of projectiles, and this would never be the arrow. The owner is sometimes NULL. shared_ptr source = dmgSource->getDirectEntity(); - + if (dynamic_pointer_cast(source) != NULL && (!server->pvp || !dynamic_pointer_cast(source)->isAllowedToAttackPlayers()) ) { return false; @@ -595,7 +595,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) bool returnVal = Player::hurt(dmgSource, dmg); if( returnVal ) - { + { // 4J Stu - Work out the source of this damage for telemetry m_lastDamageSource = eTelemetryChallenges_Unknown; @@ -667,7 +667,7 @@ bool ServerPlayer::hurt(DamageSource *dmgSource, int dmg) m_lastDamageSource = eTelemetryPlayerDeathSource_Ghast; break; }; - } + } }; } @@ -707,7 +707,7 @@ void ServerPlayer::changeDimension(int i) INetworkPlayer *checkPlayer = servPlayer->connection->getNetworkPlayer(); if(thisPlayer != checkPlayer && checkPlayer != NULL && thisPlayer->IsSameSystem( checkPlayer ) && !servPlayer->wonGame ) { - servPlayer->wonGame = true; + servPlayer->wonGame = true; servPlayer->connection->send( shared_ptr( new GameEventPacket(GameEventPacket::WIN_GAME, thisPlayer->GetUserIndex() ) ) ); app.DebugPrintf("Sending packet to %d\n", thisPlayer->GetUserIndex()); } @@ -759,7 +759,7 @@ void ServerPlayer::take(shared_ptr e, int orgCount) if (e->GetType() == eTYPE_ARROW) { entityTracker->broadcast(e, shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); - } + } if (e->GetType() == eTYPE_EXPERIENCEORB) { entityTracker->broadcast(e, shared_ptr( new TakeItemEntityPacket(e->entityId, entityId) ) ); @@ -841,7 +841,7 @@ bool ServerPlayer::startCrafting(int x, int y, int z) { app.DebugPrintf("ServerPlayer tried to open crafting container when one was already open\n"); } - + return true; } @@ -858,7 +858,7 @@ bool ServerPlayer::startEnchanting(int x, int y, int z) else { app.DebugPrintf("ServerPlayer tried to open enchanting container when one was already open\n"); - } + } return true; } @@ -876,7 +876,7 @@ bool ServerPlayer::startRepairing(int x, int y, int z) else { app.DebugPrintf("ServerPlayer tried to open enchanting container when one was already open\n"); - } + } return true; } @@ -932,7 +932,7 @@ bool ServerPlayer::openTrap(shared_ptr trap) { app.DebugPrintf("ServerPlayer tried to open dispenser when one was already open\n"); } - + return true; } @@ -1234,7 +1234,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxEnemies))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxEnemies))); } } break; @@ -1245,7 +1245,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxVillagers))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxVillagers))); } } break; @@ -1255,7 +1255,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredPigsSheepCows))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredPigsSheepCows))); } } break; @@ -1265,7 +1265,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredChickens))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredChickens))); } } break; @@ -1275,7 +1275,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredMooshrooms))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredMooshrooms))); } } break; @@ -1286,7 +1286,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredWolves))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBredWolves))); } } break; @@ -1297,7 +1297,7 @@ void ServerPlayer::displayClientMessage(int messageId) shared_ptr player = server->getPlayers()->players[i]; if(shared_from_this()==player) { - player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantShearMooshroom))); + player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantShearMooshroom))); } } break; @@ -1321,7 +1321,7 @@ void ServerPlayer::displayClientMessage(int messageId) { player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerCantSpawnInPeaceful))); } - } + } break; case IDS_MAX_BOATS: @@ -1332,7 +1332,7 @@ void ServerPlayer::displayClientMessage(int messageId) { player->connection->send(shared_ptr( new ChatPacket(name, ChatPacket::e_ChatPlayerMaxBoats))); } - } + } break; default: @@ -1391,7 +1391,7 @@ void ServerPlayer::onEffectRemoved(MobEffectInstance *effect) connection->send(shared_ptr( new RemoveMobEffectPacket(entityId, effect) ) ); } -void ServerPlayer::teleportTo(double x, double y, double z) +void ServerPlayer::teleportTo(double x, double y, double z) { connection->teleport(x, y, z, yRot, xRot); } @@ -1508,7 +1508,7 @@ void ServerPlayer::handleCollectItem(shared_ptr item) } #ifndef _CONTENT_PACKAGE -void ServerPlayer::debug_setPosition(double x, double y, double z, double nYRot, double nXRot) +void ServerPlayer::debug_setPosition(double x, double y, double z, double nYRot, double nXRot) { connection->teleport(x, y, z, nYRot, nXRot); } diff --git a/Minecraft.Client/StringTable.cpp b/Minecraft.Client/StringTable.cpp index b0c46a7b..9920a8f2 100644 --- a/Minecraft.Client/StringTable.cpp +++ b/Minecraft.Client/StringTable.cpp @@ -30,12 +30,12 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) app.getLocale(locales); bool foundLang = false; - __int64 bytesToSkip = 0; + int64_t bytesToSkip = 0; int dataSize = 0; // for( AUTO_VAR(it_locales, locales.begin()); - it_locales!=locales.end() && (!foundLang); + it_locales!=locales.end() && (!foundLang); it_locales++ ) { @@ -72,8 +72,8 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) // Read the language file for the selected language int langVersion = dis2.readInt(); - - isStatic = false; // 4J-JEV: Versions 1 and up could use + + isStatic = false; // 4J-JEV: Versions 1 and up could use if (langVersion > 0) // integers rather than wstrings as keys. isStatic = dis2.readBoolean(); @@ -109,7 +109,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize) isStatic = false; } - + // We can't delete this data in the dtor, so clear the reference bais.reset(); } diff --git a/Minecraft.Client/TileRenderer.cpp b/Minecraft.Client/TileRenderer.cpp index 3b8d4c4e..3962cc71 100644 --- a/Minecraft.Client/TileRenderer.cpp +++ b/Minecraft.Client/TileRenderer.cpp @@ -3582,9 +3582,9 @@ bool TileRenderer::tesselateCrossInWorld( Tile* tt, int x, int y, int z ) if (tt == Tile::tallgrass) { - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; - + xt += ((((seed >> 16) & 0xf) / 15.0f) - 0.5f) * 0.5f; yt += ((((seed >> 20) & 0xf) / 15.0f) - 1.0f) * 0.2f; zt += ((((seed >> 24) & 0xf) / 15.0f) - 0.5f) * 0.5f; @@ -3821,7 +3821,7 @@ bool TileRenderer::tesselateLilypadInWorld(Tile *tt, int x, int y, int z) float u1 = tex->getU1(true); float v1 = tex->getV1(true); - __int64 seed = (x * 3129871) ^ (z * 116129781l) ^ (y); + int64_t seed = (x * 3129871) ^ (z * 116129781l) ^ (y); seed = seed * seed * 42317861 + seed * 11; int dir = (int) ((seed >> 16) & 0x3); @@ -7155,7 +7155,7 @@ void TileRenderer::renderTile( Tile* tile, int data, float brightness, float fAl data = Facing::UP; } - tile->updateDefaultShape(); + tile->updateDefaultShape(); setShape(tile); glRotatef(90, 0, 1, 0); diff --git a/Minecraft.Client/Timer.cpp b/Minecraft.Client/Timer.cpp index b451c034..5cd4714a 100644 --- a/Minecraft.Client/Timer.cpp +++ b/Minecraft.Client/Timer.cpp @@ -20,9 +20,9 @@ Timer::Timer(float ticksPerSecond) void Timer::advanceTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; @@ -39,7 +39,7 @@ void Timer::advanceTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; @@ -88,9 +88,9 @@ void Timer::advanceTimeQuickly() void Timer::skipTime() { - __int64 nowMs = System::currentTimeMillis(); - __int64 passedMs = nowMs - lastMs; - __int64 msSysTime = System::nanoTime() / 1000000; + int64_t nowMs = System::currentTimeMillis(); + int64_t passedMs = nowMs - lastMs; + int64_t msSysTime = System::nanoTime() / 1000000; double now = msSysTime / 1000.0; @@ -107,7 +107,7 @@ void Timer::skipTime() accumMs += passedMs; if (accumMs > 1000) { - __int64 passedMsSysTime = msSysTime - lastMsSysTime; + int64_t passedMsSysTime = msSysTime - lastMsSysTime; double adjustTimeT = accumMs / (double) passedMsSysTime; adjustTime += (adjustTimeT - adjustTime) * 0.2f; diff --git a/Minecraft.Client/Timer.h b/Minecraft.Client/Timer.h index f9737eb0..8bea39d4 100644 --- a/Minecraft.Client/Timer.h +++ b/Minecraft.Client/Timer.h @@ -17,9 +17,9 @@ public: float passedTime; private: - __int64 lastMs; - __int64 lastMsSysTime; - __int64 accumMs; + int64_t lastMs; + int64_t lastMsSysTime; + int64_t accumMs; double adjustTime; diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h index 896f730a..45bfb31a 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h @@ -15,7 +15,7 @@ typedef struct } CONTAINER_METADATA; -typedef struct +typedef struct { char UTF8SaveFilename[MAX_SAVEFILENAME_LENGTH]; char UTF8SaveTitle[MAX_DISPLAYNAME_LENGTH]; @@ -24,7 +24,7 @@ typedef struct } SAVE_INFO,*PSAVE_INFO; -typedef struct +typedef struct { int iSaveC; PSAVE_INFO SaveInfoA; @@ -43,7 +43,7 @@ class C4JStorage public: // Structs defined in the DLC_Creator, but added here to be used in the app - typedef struct + typedef struct { unsigned int uiFileSize; DWORD dwType; @@ -61,7 +61,7 @@ public: DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs - typedef struct + typedef struct { WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; @@ -71,7 +71,7 @@ public: CACHEINFOSTRUCT; // structure to hold DLC info in TMS - typedef struct + typedef struct { DWORD dwVersion; DWORD dwNewOffers; @@ -111,7 +111,7 @@ public: enum ESaveGameControlState { ESaveGameControl_Idle=0, - ESaveGameControl_Save, + ESaveGameControl_Save, ESaveGameControl_InternalRequestingDevice, ESaveGameControl_InternalGetSaveName, ESaveGameControl_InternalSaving, @@ -122,16 +122,16 @@ public: enum ESaveGameState { ESaveGame_Idle=0, - ESaveGame_Save, + ESaveGame_Save, ESaveGame_InternalRequestingDevice, ESaveGame_InternalGetSaveName, ESaveGame_InternalSaving, ESaveGame_CopySave, ESaveGame_CopyingSave, - ESaveGame_Load, - ESaveGame_GetSavesInfo, - ESaveGame_Rename, - ESaveGame_Delete, + ESaveGame_Load, + ESaveGame_GetSavesInfo, + ESaveGame_Rename, + ESaveGame_Delete, ESaveGame_GetSaveThumbnail // Not used as an actual state in the PS4, but the game expects this to be returned to indicate success when getting a thumbnail @@ -210,7 +210,7 @@ public: }; - typedef struct + typedef struct { CHAR szFilename[256]; int iFileSize; @@ -218,14 +218,14 @@ public: } TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS; - typedef struct + typedef struct { int iCount; PTMSPP_FILE_DETAILS FileDetailsA; } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; - typedef struct + typedef struct { DWORD dwSize; PBYTE pbData; @@ -264,7 +264,7 @@ public: void SetSaveImages( PBYTE pbThumbnail,DWORD dwThumbnailBytes,PBYTE pbImage,DWORD dwImageBytes, PBYTE pbTextData ,DWORD dwTextDataBytes); // Sets the thumbnail & image for the save, optionally setting the metadata in the png C4JStorage::ESaveGameState SaveSaveData(int( *Func)(LPVOID ,const bool),LPVOID lpParam); void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); - void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ESaveGameState DoesSaveExist(bool *pbExists); bool EnoughSpaceForAMinSaveGame(); @@ -286,12 +286,12 @@ public: // DLC void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); DWORD CancelGetDLCOffers(); void ClearDLCOffers(); XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC, __uint64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC, uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); @@ -335,7 +335,7 @@ public: unsigned int CRC(unsigned char *buf, int len); // #ifdef _DEBUG -// void SetSaveName(int i); +// void SetSaveName(int i); // #endif // string table for all the Storage problems. Loaded by the application C4JStringTable *m_pStringTable; diff --git a/Minecraft.Client/Windows64/Iggy/include/rrCore.h b/Minecraft.Client/Windows64/Iggy/include/rrCore.h index e88b5f8c..fbdaa3c5 100644 --- a/Minecraft.Client/Windows64/Iggy/include/rrCore.h +++ b/Minecraft.Client/Windows64/Iggy/include/rrCore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Windows64/Miles/include/mss.h b/Minecraft.Client/Windows64/Miles/include/mss.h index 531dcbc9..754f536b 100644 --- a/Minecraft.Client/Windows64/Miles/include/mss.h +++ b/Minecraft.Client/Windows64/Miles/include/mss.h @@ -39,7 +39,7 @@ // doc system stuff #ifndef EXPAPI -#define EXPAPI +#define EXPAPI #endif #ifndef EXPTYPE #define EXPTYPE @@ -69,10 +69,10 @@ // For docs EXPGROUP(_NullGroup) #define MilesVersion "9.3m" EXPMACRO -#define MilesMajorVersion 9 EXPMACRO +#define MilesMajorVersion 9 EXPMACRO #define MilesMinorVersion 3 EXPMACRO -#define MilesBuildNumber 11 EXPMACRO -#define MilesCustomization 0 EXPMACRO +#define MilesBuildNumber 11 EXPMACRO +#define MilesCustomization 0 EXPMACRO EXPGROUP(_RootGroup) @@ -273,14 +273,14 @@ typedef void VOIDFUNC(void); //================ EXPGROUP(Basic Types) -#define AILCALL EXPTAG(AILCALL) +#define AILCALL EXPTAG(AILCALL) /* Internal calling convention that all external Miles functions use. Usually cdecl or stdcall on Windows. */ -#define AILCALLBACK EXPTAG(AILCALLBACK docproto) +#define AILCALLBACK EXPTAG(AILCALLBACK docproto) /* Calling convention that user supplied callbacks from Miles use. @@ -326,7 +326,7 @@ RADDEFSTART typedef CHAR *LPSTR, *PSTR; #ifdef IS_WIN64 - typedef unsigned __int64 ULONG_PTR, *PULONG_PTR; + typedef uint64_t ULONG_PTR, *PULONG_PTR; #else #ifdef _Wp64 #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 @@ -348,13 +348,13 @@ RADDEFSTART typedef struct HWAVEOUT__ *HWAVEOUT; typedef HWAVEIN *LPHWAVEIN; typedef HWAVEOUT *LPHWAVEOUT; - + #ifndef WAVE_MAPPER #define WAVE_MAPPER ((UINT)-1) #endif typedef struct waveformat_tag *LPWAVEFORMAT; - + typedef struct HMIDIOUT__ *HMIDIOUT; typedef HMIDIOUT *LPHMIDIOUT; typedef struct HWND__ *HWND; @@ -368,9 +368,9 @@ RADDEFSTART // If compiling MSS DLL, use __declspec(dllexport) for both // declarations and definitions // - + #ifdef IS_WIN32 - + #if !defined(FORNONWIN) && !defined(__RADNTBUILDLINUX__) #define AILLIBCALLBACK __stdcall #define AILCALL __stdcall @@ -382,20 +382,20 @@ RADDEFSTART #define AILCALLBACK __cdecl #define AILEXPORT __cdecl #endif - + #ifdef __RADINDLL__ #define DXDEC __declspec(dllexport) #define DXDEF __declspec(dllexport) #else - + #if defined( __BORLANDC__ ) || defined( MSS_SPU_PROCESS ) #define DXDEC extern #else #define DXDEC __declspec(dllimport) #endif - + #endif - + #ifdef IS_WIN64 #define MSSDLLNAME "MSS64.DLL" #define MSS_REDIST_DIR_NAME "redist64" @@ -403,11 +403,11 @@ RADDEFSTART #define MSSDLLNAME "MSS32.DLL" #define MSS_REDIST_DIR_NAME "redist" #endif - + #define MSS_DIR_SEP "\\" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP - + #endif typedef void * LPVOID; @@ -420,7 +420,7 @@ RADDEFSTART #define AILLIBCALLBACK #define AILCALL #define AILEXPORT - #define AILCALLBACK + #define AILCALLBACK #elif defined(__RADX86__) #define AILLIBCALLBACK __attribute__((cdecl)) #define AILCALL __attribute__((cdecl)) @@ -437,7 +437,7 @@ RADDEFSTART #define DXDEC extern #define DXDEF #endif - + #ifdef __RADX64__ #define MSS_REDIST_DIR_NAME "redist/x64" #elif defined(IS_X86) @@ -447,7 +447,7 @@ RADDEFSTART #else #error "No Redist Dir Specified" #endif - + #define MSS_DIR_SEP "/" #define MSS_DIR_UP ".." MSS_DIR_SEP #define MSS_DIR_UP_TWO MSS_DIR_UP MSS_DIR_UP @@ -714,7 +714,7 @@ typedef enum #ifndef FILE_ERRS #define FILE_ERRS - + #define AIL_NO_ERROR 0 #define AIL_IO_ERROR 1 #define AIL_OUT_OF_MEMORY 2 @@ -736,9 +736,9 @@ EXPTYPEBEGIN typedef SINTa HMSSENUM; EXPTYPEEND /* specifies a type used to enumerate through a list of properties. - + $:MSS_FIRST use this value to start the enumeration process. - + The Miles enumeration functions all work similarly - you set a local variable of type HMSSENUM to MSS_FIRST and then call the enumeration function until it returns 0. @@ -751,7 +751,7 @@ the enumeration function until it returns 0. // Preference names and default values // -#define AIL_MM_PERIOD 0 +#define AIL_MM_PERIOD 0 #define DEFAULT_AMP 1 // Default MM timer period = 5 msec. #define AIL_TIMERS 1 @@ -1877,7 +1877,7 @@ typedef struct _S3DSTATE // Portion of HSAMPLE that deals with 3D posi F32 lowpass_3D; // low pass cutoff computed by falloff graph. -1 if not affected. F32 spread; - + HSAMPLE owner; // May be NULL if used for temporary/internal calculations AILFALLOFFCB falloff_function; // User function for min/max distance calculations, if desired @@ -1915,7 +1915,7 @@ typedef struct _SAMPLE // Sample instance S32 index; // Numeric index of this sample SMPBUF buf[8]; // Source data buffers - + U32 src_fract; // Fractional part of source address U32 mix_delay; // ms until start mixing (decreased every buffer mix) @@ -1924,7 +1924,7 @@ typedef struct _SAMPLE // Sample instance U64 mix_bytes; // total number of bytes sent to the mixer for this sample. S32 group_id; // ID for grouped operations. - + // size of the next dynamic arrays U32 chan_buf_alloced; U32 chan_buf_used; @@ -1946,10 +1946,10 @@ typedef struct _SAMPLE // Sample instance // these are dynamic arrays F32 *auto_3D_channel_levels; // Channel levels set by 3D positioner (always 1.0 if not 3D-positioned) F32 *speaker_levels; // one level per speaker (multiplied after user or 3D) - + S8 *speaker_enum_to_source_chan; // array[MSS_SPEAKER_xx] = -1 if not present, else channel # // 99% of the time this is a 1:1 mapping and is zero. - + S32 lp_any_on; // are any of the low pass filters on? S32 user_channels_need_deinterlace; // do any of the user channels require a stereo sample to be deinterlaced? @@ -1989,7 +1989,7 @@ typedef struct _SAMPLE // Sample instance U32 low_pass_changed; // bit mask for what channels changed. - + S32 bus; // Bus assignment for this sample. S32 bus_comp_sends; // Which buses this bus routes compressor input to. S32 bus_comp_installed; // Nonzero if we have a compressor installed. @@ -2042,7 +2042,7 @@ typedef struct _SAMPLE // Sample instance SPINFO pipeline[N_SAMPLE_STAGES]; S32 n_active_filters; // # of SP_FILTER_n stages active - + // // 3D-related state for all platforms (including Xbox) // @@ -2113,14 +2113,14 @@ DXDEC void AILCALL AIL_serve(void); #ifdef IS_MAC typedef void * LPSTR; - + #define WHDR_DONE 0 - + typedef struct _WAVEIN { long temp; } * HWAVEIN; - + typedef struct _WAVEHDR { S32 dwFlags; @@ -2133,7 +2133,7 @@ DXDEC void AILCALL AIL_serve(void); S32 dwLoops; void * lpNext; U32 * reserved; - + } WAVEHDR, * LPWAVEHDR; #endif @@ -2145,7 +2145,7 @@ typedef struct _DIG_INPUT_DRIVER *HDIGINPUT; // Handle to digital input driver #ifdef IS_MAC #define AIL_DIGITAL_INPUT_DEFAULT 0 - + typedef struct _DIG_INPUT_DRIVER // Handle to digital input driver { U32 tag; // HDIN @@ -2478,7 +2478,7 @@ typedef struct _DIG_DRIVER // Handle to digital audio driver U32 last_ds_play; U32 last_ds_write; U32 last_ds_move; - + #endif #ifdef IS_X86 @@ -2661,7 +2661,7 @@ typedef struct _SEQUENCE // XMIDI sequence state table void const *EVNT; U8 const *EVNT_ptr; // Current event pointer - + U8 *ICA; // Indirect Controller Array AILPREFIXCB prefix_callback; // XMIDI Callback Prefix handler @@ -3121,13 +3121,13 @@ DXDEC S32 AILCALL AIL_timer_thread_handle(void* o_handle); #elif defined(__RADANDROID__) DXDEC void AILCALL AIL_set_asset_manager(void* asset_manager); - + DXDEC RADSS_OPEN_FUNC AILCALL RADSS_SLESInstallDriver(UINTa, UINTa); #define AIL_open_digital_driver(frequency, bits, channel, flags) \ AIL_open_generic_digital_driver(frequency, bits, channel, flags, RADSS_SLESInstallDriver(0, 0)) - + #elif defined(IS_PSP2) DXDEC RADSS_OPEN_FUNC AILCALL RADSS_PSP2InstallDriver(UINTa, UINTa); @@ -3221,7 +3221,7 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire { Str255 version_name; } MSS_VersionType; - + #define AIL_MSS_version(str,len) \ { \ long _res = HOpenResFile(0,0,"\p" MSSDLLNAME,fsRdPerm); \ @@ -3269,11 +3269,11 @@ DXDEC S32 AILCALL AIL_digital_handle_reacquire } \ } \ } - + #endif DXDEC S32 AILCALL AIL_digital_handle_release(HDIGDRIVER drvr); - + DXDEC S32 AILCALL AIL_digital_handle_reacquire (HDIGDRIVER drvr); @@ -3339,18 +3339,18 @@ DXDEC EXPAPI void AILCALL AIL_push_system_state(HDIGDRIVER dig, U32 flags, S16 c $* MILES_PUSH_VOLUME - When present, master volume will be affected in addition to sample state. If MILES_PUSH_RESET is present, the master volume will be set to 1.0f, otherwise it will be retained and only - affected when popped. + affected when popped. $- - If you want more control over whether a sample will be affected by a push or a pop operation, + If you want more control over whether a sample will be affected by a push or a pop operation, see $AIL_set_sample_level_mask. - + */ DXDEC EXPAPI void AILCALL AIL_pop_system_state(HDIGDRIVER dig, S16 crossfade_ms); /* - Pops the current system state and returns the system to the way it + Pops the current system state and returns the system to the way it was before the last push. $:dig The driver to pop. @@ -3374,7 +3374,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_level_mask(HSAMPLE S, U8 mask); $:S The sample to set the mask for. $:mask The bitmask of levels for which the sample will play. - Under normal push/pop operations, a sample's mask is set when it is + Under normal push/pop operations, a sample's mask is set when it is started to the level the system is at. If the system is pushed without a reset, then the mask is adjusted to include the new level. When a system is popped, if the sample is going to continue playing, @@ -3435,7 +3435,7 @@ DXDEC EXPAPI HSAMPLE AILCALL AIL_allocate_bus(HDIGDRIVER dig); $:return The HSAMPLE for the new bus. A bus allows you to treat a group of samples as one sample. With the bus sample you can - do almost all of the things you can do with a normal sample handle. The only exception + do almost all of the things you can do with a normal sample handle. The only exception is you can't adjust the playback rate of the sample. Use $AIL_bus_sample_handle to get the HSAMPLE associated with a bus. @@ -3495,7 +3495,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sample_bus(HSAMPLE S); DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_index, SAMPLESTAGE filter_stage, S32 input_bus_index); /* - Installs the Compressor filter on to a bus, using another bus as the input for + Installs the Compressor filter on to a bus, using another bus as the input for compression/limiting. $:dig The driver the busses exist on. @@ -3508,7 +3508,7 @@ DXDEC EXPAPI S32 AILCALL AIL_install_bus_compressor(HDIGDRIVER dig, S32 bus_inde its signal strength to the filter, allowing it to attenuate the bus_index bus based on another bus's contents. - To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and + To control the compressor parameters, access the bus's HSAMPLE via $AIL_bus_sample_handle and use $AIL_sample_stage_property exactly as you would any other filter. The filter's properties are documented under $(Compressor Filter) */ @@ -4325,7 +4325,7 @@ typedef void (AILCALLBACK* AILSTREAMCB) (HSTREAM stream); #define MSS_STREAM_CHUNKS 8 -typedef struct _STREAM +typedef struct _STREAM { S32 block_oriented; // 1 if this is an ADPCM or ASI-compressed stream S32 using_ASI; // 1 if using ASI decoder to uncompress stream data @@ -4349,7 +4349,7 @@ typedef struct _STREAM S32 read_IO_index; // index of buffer to be loaded into Miles next S32 bufsize; // size of each buffer - + U32 datarate; // datarate in bytes per second S32 filerate; // original datarate of the file S32 filetype; // file format type @@ -4987,7 +4987,7 @@ typedef struct OGG_INFO; DXDEC void AILCALL AIL_inspect_Ogg (OGG_INFO *inspection_state, - U8 *Ogg_file_image, + U8 *Ogg_file_image, S32 Ogg_file_size); DXDEC S32 AILCALL AIL_enumerate_Ogg_pages (OGG_INFO *inspection_state); @@ -5102,10 +5102,10 @@ DXDEC HDIGDRIVER AILCALL AIL_primary_digital_driver (HDIGDRIVER new_primary); // 3D-related calls // -DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, +DXDEC S32 AILCALL AIL_room_type (HDIGDRIVER dig, S32 bus_index); -DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, +DXDEC void AILCALL AIL_set_room_type (HDIGDRIVER dig, S32 bus_index, S32 room_type); @@ -5180,7 +5180,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_lowpass_falloff(HSAMPLE S, MSS $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If + This marks a sample as having a low pass cutoff that varies as a function of distance to the listener. If a sample has such a graph, $AIL_set_sample_low_pass_cut_off will be called constantly, and thus shouldn't be called otherwise. @@ -5195,8 +5195,8 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_exclusion_falloff(HSAMPLE S, M $:graph The array of points to use as the graph. $:pointcount The number of points passed in. Must be less than or equal to MILES_MAX_FALLOFF_GRAPH_POINTS. Passing 0 removes the graph. - This marks a sample as having an exclusion that varies as a function of distance to the listener. If - a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion + This marks a sample as having an exclusion that varies as a function of distance to the listener. If + a sample has such a graph, auto_3D_wet_atten will be disabled to prevent double affects, as exclusion affects reverb wet level. The graph is evaluated the same as $AIL_set_sample_3D_volume_falloff. @@ -5230,7 +5230,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_position_segments(HSAMPLE S, MSSVECT other computations (cones, falloffs, etc). Spatialization is done using all segments as a directional source. - If there is neither spread falloff nor volume falloff specified, spread will be automatically applied + If there is neither spread falloff nor volume falloff specified, spread will be automatically applied when the listener is within min_distance to the closest point. See $AIL_set_sample_3D_spread_falloff and $AIL_set_sample_3D_volume_falloff. @@ -5243,7 +5243,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sample_3D_spread(HSAMPLE S, F32 spread); $:S Sample to affect. $:spread The value to set the spread to. - Spread is how much the directionality of a sample "spreads" to more speakers - emulating + Spread is how much the directionality of a sample "spreads" to more speakers - emulating the effect a sound has when it occupies more than a point source. For instance, a sound point source that sits directly to the left of the listener would have a very strong left speaker signal, and a fairly weak right speaker signal. Via spread, the signal would be @@ -5392,7 +5392,7 @@ EXPGROUP(Miles High Level Event System) EXPTYPE typedef struct MSSSOUNDBANK {}; /* Internal structure. - + Use $HMSOUNDBANK instead. */ @@ -5401,7 +5401,7 @@ EXPTYPE typedef struct MSSSOUNDBANK {}; EXPTYPE typedef struct SoundBank *HMSOUNDBANK; /* Describes a handle to an open sound bank. - + This handle typedef refers to an open soundbank which is usually obtained from the $AIL_add_soundbank function. */ @@ -5424,7 +5424,7 @@ DXDEC EXPAPI void AILCALL AIL_close_soundbank(HMSOUNDBANK bank); Close a soundbank previously opened with $AIL_open_soundbank. $:bank Soundbank to close. - + Close a soundbank previously opened with $AIL_open_soundbank. Presets/events loaded from this soundbank are no longer valid. */ @@ -5448,7 +5448,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); $:return A pointer to the name of the sound bank, or 0 if the bank is invalid. - The name of the bank is the name used in asset names. This is distinct from the + The name of the bank is the name used in asset names. This is distinct from the file name of the bank. The return value should not be deleted. @@ -5457,7 +5457,7 @@ DXDEC EXPAPI char const * AILCALL AIL_get_soundbank_name(HMSOUNDBANK bank); DXDEC EXPAPI S32 AILCALL AIL_get_soundbank_mem_usage(HMSOUNDBANK bank); /* Returns the amount of data used by the soundbank management structures. - + $:bank Soundbank to query. $:return Total memory allocated. @@ -5476,7 +5476,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_presets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sound presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5503,7 +5503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_environment_presets(HMSOUNDBANK bank, HMS $:return Returns 0 when enumeration is complete. Enumerates the environment presets available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* PresetName = 0; @@ -5530,7 +5530,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* $:return Returns 0 when enumeration is complete. Enumerates the sounds available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* SoundName = 0; @@ -5549,7 +5549,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_assets(HMSOUNDBANK bank, HMSSENUM* Note that name should NOT be deleted by the caller - this points at memory owned by Miles. */ - + DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, char const * list, char const ** name); /* Enumerate the events stored in a soundbank. @@ -5561,7 +5561,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_events(HMSOUNDBANK bank, HMSSENUM* next, $:return Returns 0 when enumeration is complete. Enumerates the events available inside of a bank file. Example usage: - + ${ HMSSENUM Token = MSS_FIRST; const char* EventName = 0; @@ -5624,7 +5624,7 @@ DXDEC EXPAPI S32 AILCALL AIL_apply_sound_preset(HSAMPLE sample, HMSOUNDBANK bank $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. This will alter the properties on a given sample, based on the given preset. -*/ +*/ DXDEC EXPAPI S32 AILCALL AIL_unapply_raw_sound_preset(HSAMPLE sample, void* preset); /* @@ -5644,7 +5644,7 @@ DXDEC EXPAPI S32 AILCALL AIL_unapply_sound_preset(HSAMPLE sample, HMSOUNDBANK ba $:return Returns 0 on fail - check for sample/bank validity, and that the preset is in the correct bank. Presets may or may not affect any given property. Only the properties affected by the specified - preset will have their values restored to default. + preset will have their values restored to default. */ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPOUT void* output, S32 isfloat); @@ -5658,7 +5658,7 @@ typedef S32 (*MilesResolveFunc)(void* context, char const* exp, S32 explen, EXPO $:isfloat nonzero if the output needs to be a float. The function callback should convert variable expressions in to an output value of the - requested type. + requested type. */ DXDEC EXPAPI S32 AILCALL AIL_resolve_raw_sound_preset(void* preset, void* context, MilesResolveFunc eval); @@ -5777,7 +5777,7 @@ DXDEC EXPAPI S32 AILCALL AIL_sound_asset_info(HMSOUNDBANK bank, char const* name $:name The name of the sound asset to find. $:out_name Optional - Pointer to a buffer that is filled with the sound filename to use for loading. $:out_info Pointer to a $MILESBANKSOUNDINFO structure that is filled with meta data about the sound asset. - $:return Returns the byte size of the buffer required for out_name. + $:return Returns the byte size of the buffer required for out_name. This function must be called in order to resolve the sound asset name to something that can be used by miles. To ensure safe buffer containment, call @@ -5832,7 +5832,7 @@ typedef struct _MEMDUMP* HMEMDUMP; ReturnType = "HMSSEVENTCONSTRUCT", "An empty event to be passed to the various step addition functions, or 0 if out of memory." - Discussion = "Primarily designed for offline use, this function is the first step in + Discussion = "Primarily designed for offline use, this function is the first step in creating an event that can be consumed by the MilesEvent system. Usage is as follows: HMSSEVENTCONSTRUCT hEvent = AIL_create_event(); @@ -5850,7 +5850,7 @@ typedef struct _MEMDUMP* HMEMDUMP; Note that if immediately passed to AIL_enqueue_event(), the memory must remain valid until the following $AIL_complete_event_queue_processing. - + Events are generally tailored to the MilesEvent system, even though there is nothing preventing you from writing your own event system, or creation ui. " @@ -5906,7 +5906,7 @@ EXPTYPEEND /* Determines the usage of the sound names list in the $AIL_add_start_sound_event_step. - $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same + $:MILES_START_STEP_RANDOM Randomly select from the list, and allow the same sound to play twice in a row. This is the only selection type that doesn't require a state variable. $:MILES_START_STEP_NO_REPEATS Randomly select from the list, but prevent the last sound from being the same. @@ -5926,10 +5926,10 @@ EXPTYPEEND Name = "AIL_add_start_sound_event_step", "Adds a step to a given event to start a sound with the given specifications." In = "HMSSEVENTCONSTRUCT", "i_Event", "The event to add the step to." - In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. - If there are multiple names listed, the sound will be chosen at random based on the given weights. This + In = "const char*", "i_SoundNames", "The names and associated weights for the event step to choose from. + If there are multiple names listed, the sound will be chosen at random based on the given weights. This string is of the form 'BankName1/SoundName1:Weight1:BankName2/SoundName2:Weight2:' etc. The string must always - terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use + terminate in a ':'. Weight must be between 0 and 200. To provide a null sound to randomly choose to not play anything, use an empty string as an entry." In = "const char*", "i_PresetName", "[optional] The name of the preset, of the form 'PresetList/PresetName'" @@ -5944,7 +5944,7 @@ EXPTYPEEND In = "U8", "i_CanLoad", "If nonzero, the sound is allowed to hit the disk instead of only accessing cached sounds. If true, this might cause a hitch." In = "U16", "i_Delay", "The minimum delay in ms to apply to the sound before start." In = "U16", "i_DelayMax", "The maximum delay in ms to apply to the sound before start." - In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound + In = "U8", "i_Priority", "The priority to assign to the sound. If a sound encounters a limit based on its labels, it will evict any sound with a priority strictly less than the given priority." In = "U8", "i_LoopCount", "The loop count as per AIL_set_sample_loop_count." In = "const char*", "i_StartOffset", "[optional] The name of the marker to use as the sound's initial offset." @@ -5969,19 +5969,19 @@ DXDEC S32 AILCALL AIL_add_start_sound_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_SoundNames, - const char* i_PresetName, + const char* i_PresetName, U8 i_PresetIsDynamic, const char* i_EventName, const char* i_StartMarker, const char* i_EndMarker, char const* i_StateVar, char const* i_VarInit, - const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, + const char* i_Labels, U32 i_Streaming, U8 i_CanLoad, U16 i_Delay, U16 i_DelayMax, U8 i_Priority, U8 i_LoopCount, const char* i_StartOffset, F32 i_VolMin, F32 i_VolMax, F32 i_PitchMin, F32 i_PitchMax, F32 i_FadeInTime, - U8 i_EvictionType, + U8 i_EvictionType, U8 i_SelectType ); @@ -6004,7 +6004,7 @@ AIL_add_start_sound_event_step( In order to release the data loaded by this event, AIL_add_uncache_sounds_event_step() needs to be called with the same parameters. - + If you are using MilesEvent, the data is refcounted so the sound will not be freed until all samples using it complete." } @@ -6089,7 +6089,7 @@ DXDEC S32 AILCALL AIL_add_control_sounds_event_step( - HMSSEVENTCONSTRUCT i_Event, + HMSSEVENTCONSTRUCT i_Event, const char* i_Labels, const char* i_MarkerStart, const char* i_MarkerEnd, const char* i_Position, const char* i_PresetName, U8 i_PresetApplyType, @@ -6191,7 +6191,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Defines a named blend function to be referenced by a blended sound later. $:i_Event The event to add the step to. - $:i_Name The name of the blend. This is the name that will be + $:i_Name The name of the blend. This is the name that will be referenced by the state variable in start sound, as well as the variable name to set by the game to update the blend for an instance. $:i_SoundCount The number of sounds this blend will affect. Max 10. @@ -6226,7 +6226,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_setblend_event_step(HMSSEVENTCONSTRUCT i_Event, Miles max sample count." } */ -DXDEC S32 AILCALL +DXDEC S32 AILCALL AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitName, const char* i_SoundLimits); /*! @@ -6257,8 +6257,8 @@ AIL_add_sound_limit_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_LimitNa AIL_add_persist_preset_event_step(hEvent, 0, `"Underwater`", 0);" } */ -DXDEC S32 AILCALL -AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, +DXDEC S32 AILCALL +AIL_add_persist_preset_event_step(HMSSEVENTCONSTRUCT i_Event, const char* i_PresetName, const char* i_PersistName, const char* i_Labels, U8 i_IsDynamic ); @@ -6272,13 +6272,13 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_contents(HMSOUNDBANK bank, char const * n thus shouldn't be checked via strlen, etc. $:return Returns 0 on fail. - Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, + Normally, event contents are meant to be handled by the Miles high-level system via $AIL_enqueue_event, rather than inspected directly. */ DXDEC EXPAPI S32 AILCALL AIL_add_clear_state_event_step(HMSSEVENTCONSTRUCT i_Event); /* - Clears all persistent state in the runtime. + Clears all persistent state in the runtime. $:i_Event The event to add the step to. @@ -6311,7 +6311,7 @@ DXDEC EXPAPI S32 AILCALL AIL_add_enable_limit_event_step(HMSSEVENTCONSTRUCT i_Ev DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, char const* i_Base, char const* i_Amp, char const* i_Freq, S32 i_Invert, S32 i_Polarity, S32 i_Waveform, S32 i_DutyCycle, S32 i_IsLFO); /* Adds a step to define a variable that oscillates over time. - + $:i_Event The event to add the step to. $:i_Name The nane of the variable to oscillate. $:i_Base The value to oscillate around, or a variable name to use as the base. @@ -6327,15 +6327,15 @@ DXDEC EXPAPI S32 AILCALL AIL_add_set_lfo_event_step(HMSSEVENTCONSTRUCT i_Event, DXDEC EXPAPI S32 AILCALL AIL_add_move_var_event_step(HMSSEVENTCONSTRUCT i_Event, char const* i_Name, const F32 i_Times[2], const S32 i_InterpolationTypes[2], const F32 i_Values[3]); /* Adds a step to set and move a variable over time on a curve. - + $:i_Event The event to add the step to. $:i_Name The variable to move. $:i_Times The midpoint and final times for the curves $:i_InterpolationTypes The curve type for the two curves - Curve In (0), Curve Out (1), S-Curve (2), Linear (3) $:i_Values The initial, midpoint, and final values for the variable. - + The variable is locked to this curve over the timeperiod - no interpolation from a previous value is done. - + If an existing move var exists when the new one is added, the old one is replaced. */ @@ -6450,7 +6450,7 @@ struct EVENT_STEP_INFO U8 isdynamic; } persist; - struct + struct { MSSSTRINGC name; MSSSTRINGC labels; @@ -6522,7 +6522,7 @@ struct EVENT_STEP_INFO the string location of the next event step in the buffer." Discussion = "This function parses the event string in to a struct for usage by the user. This function should only be - used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the + used by the MilesEvent system. It returns the pointer to the next step to be passed to this function to get the next step. In this manner it can be used in a loop: // Create an event to stop all sounds. @@ -6610,11 +6610,11 @@ EXPTYPE typedef void* HEVENTSYSTEM; DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_startup_event_system(HDIGDRIVER dig, S32 command_buf_len, EXPOUT char* memory_buf, S32 memory_len); /* Initializes the Miles Event system and associates it with an open digital driver. - + $:dig The digital sound driver that this event system should use. $:command_buf_len An optional number of bytes to use for the command buffer. If you pass 0, a reasonable default will be used (currently 5K). - $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. - Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. + $:memory_buf An optional pointer to a memory buffer buffer that the event system will use for all event allocations. + Note that the sound data itself is not stored in this buffer - it is only for internal buffers, the command buffer, and instance data. Use 0 to let Miles to allocate this buffer itself. $:memory_len If memory_buf is non-null, then this parameter provides the length. If memory_buf is null, the Miles will allocate this much memory for internal buffers. If both memory_buf and memory_len are null, the Miles will allocate reasonable default (currently 64K). @@ -6633,8 +6633,8 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); $:return A handle to the event system to use in various high level functions. Both systems will access the same set of loaded soundbanks, and are updated when $AIL_begin_event_queue_processing is called. - - To enqueue events to the new system, use $AIL_enqueue_event_system. + + To enqueue events to the new system, use $AIL_enqueue_event_system. To iterate the sounds for the new system, pass the $HEVENTSYSTEM as the first parameter to $AIL_enumerate_sound_instances. @@ -6646,7 +6646,7 @@ DXDEC EXPAPI HEVENTSYSTEM AILCALL AIL_add_event_system(HDIGDRIVER dig); DXDEC EXPAPI void AILCALL AIL_shutdown_event_system( void ); /* Shuts down the Miles event system. - + This function will closes everything in the event system - it ignores reference counts. It will free all event memory, sound banks, and samples used by the system. */ @@ -6660,10 +6660,10 @@ DXDEC EXPAPI HMSOUNDBANK AILCALL AIL_add_soundbank(char const * filename, char c $:return The handle to the newly loaded soundbank (zero on failure). This function opens the sound bank and makes it available to the event system. The filename - is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. + is the name on the media, and the name is the symbolic name you used in the Miles Sound Studio. You might, for example, be using a soundbank with a platform extension, like: 'gamebank_ps3.msscmp', and while using the name 'gamebank' for authoring and auditioning. - + Sound data is not loaded when this function is called - it is only loaded when the relevant Cache Sounds is played, or a sound requiring it plays. @@ -6685,7 +6685,7 @@ DXDEC EXPAPI S32 AILCALL AIL_release_soundbank(HMSOUNDBANK bank); Any other data references still existing (queued events, persisted presets, etc) will report errors when used, but will not crash. - + Releasing a sound bank does not free any cached sounds loaded from the bank - any sounds from the bank should be freed via a Purge Sounds event step. If this does not occur, the sound data will still be loaded, but the sound metadata will be gone, so Start Sound events will not work. Purge Sounds will still work. @@ -6698,24 +6698,24 @@ DXDEC U8 const * AILCALL AIL_find_event(HMSOUNDBANK bank,char const* event_name) (EXPAPI removed to prevent release in docs) Searches for an event by name in the event system. - + $:bank The soundbank to search within, or 0 to search all open banks (which is the normal case). $:event_name The name of the event to find. This name should be of the form "soundbank/event_list/event_name". $:return A pointer to the event contents (or 0, if the event isn't found). - + This function is normally used as the event parameter for $AIL_enqueue_event. It searches one or all open soundbanks for a particular event name. - - This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with + + This is deprecated. If you know the event name, you should use $AIL_enqueue_event_by_name, or $AIL_enqueue_event with MILESEVENT_ENQUEUE_BY_NAME. - + Events that are not enqueued by name can not be tracked by the Auditioner. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_system(HEVENTSYSTEM system, U8 const * event, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to a specific system. Used only if you have multiple event systems running. - + $:system The event system to attach the event to. $:return See $AIL_enqueue_event for return description. @@ -6728,10 +6728,10 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_by_name(char const* name); $:name The full name of the event, eg "soundbank/path/to/event". $:return See $AIL_enqueue_event for return description. - - This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. - - For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent + + This is the most basic way to enqueue an event. It enqueues an event by name, and as a result the event will be tracked by the auditioner. + + For when you need more control over the event, but still want it to be tracked by the auditioner, it is equivalent to calling $AIL_enqueue_event_end_named($AIL_enqueue_event_start(), name) For introduction to the auditioning system, see $integrating_events. @@ -6743,9 +6743,9 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); $:return A token used for passing to functions that add data to the event. - This is used to pass more data to an event that will be executed. For instance, if + This is used to pass more data to an event that will be executed. For instance, if an event is going to spatialize a sound, but there's no need to move the sound over the course of - its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a + its lifetime, you can add positional data to the event via $AIL_enqueue_event_position. When a sound is started it will use that for its initial position, and there is no need to do any game object <-> event id tracking. @@ -6762,7 +6762,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_start(); The enqueue process is still completely thread safe. No locks are used, however only 8 enqueues can be "assembling" at the same time - if more than that occur, the $AIL_enqueue_event_start - will yield the thread until a slot is open. + will yield the thread until a slot is open. The ONLY time that should happen is if events enqueues are started but never ended: @@ -6838,7 +6838,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, user buffer contents, and then exposed during sound enumeration. This is equivalent in spirit to the void* value that often accompanies callbacks. In this case, user_buffer_len is ignored, as user_buffer is never dereferenced. - $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and + $* Buffer If user_buffer_is_ptr is 0, then user_buffer_len bytes are copied from user_buffer and carried with the event. During sound enumeration this buffer is made available, and you never have to worry about memory management. $- @@ -6855,7 +6855,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data->game_stat = 1; data->needed_info = 2; - // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound + // Pointer - the "data" pointer will be copied directly, so we can't free() "data" until after the sound // completes and we're done using it in the enumeration loop. S32 ptr_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&ptr_token, data, 0, 1); @@ -6874,7 +6874,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_buffer(S32* token, void* user_buffer, data.game_stat = 1; data.needed_info = 2; - // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use + // Buffer - the "data" structure will be copied internally, so we can free() the data - or just use // a stack variable like this S32 buf_token = AIL_enqueue_event_start(); AIL_enqueue_event_buffer(&buf_token, &data, sizeof(data), 0); @@ -6895,7 +6895,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_variablef(S32* token, char const* nam $:value The value of the variable to set. $:return 0 if the enqueue buffer is full - When a sound starts, the given variable will be set to the given value prior to any possible + When a sound starts, the given variable will be set to the given value prior to any possible references being used by presets. */ @@ -6904,7 +6904,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_filter(S32* token, U64 apply_to_ID); Limits the effects of the event to sounds started by the given ID. $:token A token created with $AIL_enqueue_event_start - $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an + $:apply_to_ID The ID to use for filtering. This can be either a sound or event ID. For an event, it will apply to all sounds started by the event, and any events queued by that event. $:return 0 if the enqueue buffer is full @@ -6932,7 +6932,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enqueue_event_selection(S32* token, U32 selection); $:selection The value to use for selecting the sound to play. $:return 0 if the enqueue buffer is full - The selection index is used to programatically select a sound from the + The selection index is used to programatically select a sound from the loaded banks. The index passed in replaces any numeric value at the end of the sound name existing in any start sound event step. For example, if a start sound event plays "mybank/sound1", and the event is queued with @@ -6969,52 +6969,52 @@ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event_end_named(S32 token, char const* even As with all of the enqueue functions it is completely thread-safe. Upon completion of this function, the enqueue slot is release and available for another - $AIL_enqueue_event_start. + $AIL_enqueue_event_start. */ DXDEC EXPAPI U64 AILCALL AIL_enqueue_event(U8 const * event_or_name, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags, U64 apply_to_ID ); /* Enqueue an event to be processed by the next $AIL_begin_event_queue_processing function. - - $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. + + $:event_or_name Pointer to the event contents to queue, or the name of the event to find and queue. If an event, the contents must be valid until the next call to $AIL_begin_event_queue_processing. If a name, the string is copied internally and does not have any lifetime requirements, and MILES_ENQUEUE_BY_NAME must be present in enqueue_flags. - $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. - This data is then accessible later, when enumerating the instances. + $:user_buffer Pointer to a user buffer. Depending on $(AIL_enqueue_event::enqueue_flags), this pointer can be saved directly, or its contents copied into the sound instance. + This data is then accessible later, when enumerating the instances. $:user_buffer_len Size of the buffer pointed to by user_buffer. $:enqueue_flags Optional $MILESEVENTENQUEUEFLAGS logically OR'd together that control how to enqueue this event (default is 0). $:apply_to_ID Optional value that is used for events that affect sound instances. Normally, - when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if + when Miles triggers one of these event steps, it matches the name and labels stored with the event step. However, if you specify an apply_to_ID value, then event step will only run on sounds that matches this QueuedID,InstanceID,or EventID too. This is how you - execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. + execute events only specific sound instances. QueuedIDs are returned from each call $AIL_enqueue_event. InstanceIDs and EventIDs are returned from $AIL_enumerate_sound_instances. - $:return On success, returns QueuedID value that is unique to this queued event for the rest of this + $:return On success, returns QueuedID value that is unique to this queued event for the rest of this program run (you can use this ID to uniquely identify sounds triggered from this event). - + This function enqueues an event to be triggered - this is how you begin execution of an event. First, you queue it, and then later (usually once a game frame), you call $AIL_begin_event_queue_processing to execute an event. - - This function is very lightweight. It does nothing more than post the event and data to a + + This function is very lightweight. It does nothing more than post the event and data to a command buffer that gets executed via $AIL_begin_event_queue_processing. The user_buffer parameter can be used in different ways. If no flags are passed in, then Miles will copy the data from user_buffer (user_buffer_len bytes long) and store the data with the queued sound - you can then free the user_buffer data completely! This lets Miles keep track - of all your sound related memory directly and is the normal way to use the system (it is very + of all your sound related memory directly and is the normal way to use the system (it is very convenient once you get used to it). If you instead pass the MILESEVENT_ENQUEUE_BUFFER_PTR flag, then user_buffer pointer will simply be associated with each sound that this event may start. In this case, user_buffer_len is ignored. - - In both cases, when you later enumerate the sound instances, you can access your sound data + + In both cases, when you later enumerate the sound instances, you can access your sound data with the $(MILESEVENTSOUNDINFO::UserBuffer) field. - + You can call this function from any number threads - it's designed to be called from anywhere in your game. If you want events you queue to be captured by Miles Studio, then they have to be passed by name. This can be done - by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and + by either using the convenience function $AIL_enqueue_event_by_name, or by using the MILESEVENT_ENQUEUE_BY_NAME flag and passing the name in event_or_name. For introduction to the auditioning system, see $integrating_events. */ @@ -7044,23 +7044,23 @@ DXDEC EXPAPI S32 AILCALL AIL_begin_event_queue_processing( void ); /* Begin execution of all of the enqueued events. - $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events + $:return Return 0 on failure. The only failures are unrecoverable errors in the queued events (out of memory, bank file not found, bad data, etc). You can get the specific error by calling $AIL_last_error. - + This function executes all the events currently in the queue. This is where all major processing takes place in the event system. - + Once you execute this functions, then sound instances will be in one of three states: - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7082,7 +7082,7 @@ ${ MILESEVENTSOUNDINFO Info; HMSSENUM SoundEnum = MSS_FIRST; - while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, MILESEVENT_SOUND_STATUS_PENDING | MILESEVENT_SOUND_STATUS_COMPLETE, 0, &Info ) ) { game_type * game_data = (game_type*) Info.UserBuffer; // returns the game_data pointer from the enqueue @@ -7098,13 +7098,13 @@ ${ } } - $AIL_complete_event_queue_processing( ); - $} - - Note that if any event step drastically fails, the rest of the command queue is + $AIL_complete_event_queue_processing( ); + $} + + Note that if any event step drastically fails, the rest of the command queue is skipped, and this function returns 0! For this reason, you shouldn't assume that a start sound event will always result in a completed sound later. - + Therefore, you should allocate memory that you want associated with a sound instance during the enumeration loop, rather than at enqueue time. Otherwise, you need to detect that the sound didn't start and then free the memory (which can be complicated). @@ -7120,7 +7120,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO HSTREAM Stream; void* UserBuffer; S32 UserBufferLen; - S32 Status; + S32 Status; U32 Flags; S32 UsedDelay; F32 UsedVolume; @@ -7130,10 +7130,10 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO } MILESEVENTSOUNDINFO; /* Sound instance data that is associated with each active sound instance. - + $:QueuedID A unique ID that identifies the queued event that started this sound. Returned from each call to $AIL_enqueue_event. $:EventID A unique ID that identifies the actual event that started this sound. This is the same as QueuedID unless the sound - was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from + was started by a completion event or a event exec step. In that case, the QueuedID represents the ID returned from $AIL_enqueue_event, and EventID represents the completion event. $:InstanceID A unique ID that identified this specific sound instance (note that one QueuedID can trigger multiple InstanceIDs). $:Sample The $HSAMPLE for this playing sound. @@ -7148,7 +7148,7 @@ EXPTYPE typedef struct _MILESEVENTSOUNDINFO $:UsedSound The name of the sound used as a result of randomization. This pointer should NOT be deleted and is only valid for the until the next call in to Miles. $:HasCompletionEvent Nonzero if the sound will fire an event upon completion. - + This structure is returned by the $AIL_enumerate_sound_instances function. It returns information about an active sound instance. */ @@ -7157,7 +7157,7 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7183,14 +7183,14 @@ DXDEC EXPAPI void AILCALL AIL_set_variable_int(UINTa context, char const* name, // A preset referencing "MyVar" for FirstSound will get 10. Any other sound will // get 20. $} - + */ DXDEC EXPAPI void AILCALL AIL_set_variable_float(UINTa context, char const* name, F32 value); /* Sets a named variable that the designer can reference in the tool. - $:context The context the variable is set for. Can be either a $HEVENTSYSTEM + $:context The context the variable is set for. Can be either a $HEVENTSYSTEM to set a global variable for a specific system, 0 to set a global variable for the default system, or an $HMSSENUM from $AIL_enumerate_sound_instances. $:name The name of the variable to set. @@ -7265,7 +7265,7 @@ DXDEC EXPAPI void AILCALL AIL_set_sound_start_offset(HMSSENUM sound, S32 offset, the sound starting. Generally you don't need to do this manually, since the sound designer should do this, however if you need to restart a sound that stopped - for example a stream that went to error - you will have to set the start position via code. - + However, since there can be a delay between the time the sound is first seen in the sound iteration and the time it gets set to the data, start positions set via the low level miles calls can get lost, so use this. @@ -7281,11 +7281,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $:statuses Or-ed list of status values to enumerate. Use 0 for all status types. $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:search_for_ID Match only instances that have a QueuedID,InstanceID,or EventID that matches this value. Use 0 to skip ID matching. - $:info Returns the data for each sound instance. + $:info Returns the data for each sound instance. $:return Returns 0 when enumeration is complete. Enumerates the sound instances. This will generally be used between - calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to + calls to $AIL_begin_event_queue_processing and $AIL_complete_event_queue_processing to manage the sound instances. The label_query is a list of labels to match, separated by commas. By default, comma-separated @@ -7302,11 +7302,11 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_sound_instances(HEVENTSYSTEM system, HMSS $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PENDING)[MILESEVENT_SOUND_STATUS_PENDING] - these are new sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_PLAYING)[MILESEVENT_SOUND_STATUS_PLAYING] - these are sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $(MILESEVENTSOUNDSTATUS::MILESEVENT_SOUND_STATUS_COMPLETE)[MILESEVENT_SOUND_STATUS_COMPLETE] - these are sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). @@ -7315,7 +7315,7 @@ ${ HMSSENUM SoundEnum = MSS_FIRST; MILESEVENTSOUNDINFO Info; - while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) + while ( $AIL_enumerate_sound_instances( &SoundEnum, 0, 0, &Info ) ) { if ( Info.Status != MILESEVENT_SOUND_STATUS_COMPLETE ) { @@ -7330,23 +7330,23 @@ $} EXPTYPEBEGIN typedef S32 MILESEVENTSOUNDSTATUS; #define MILESEVENT_SOUND_STATUS_PENDING 0x1 -#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 +#define MILESEVENT_SOUND_STATUS_PLAYING 0x2 #define MILESEVENT_SOUND_STATUS_COMPLETE 0x4 EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_STATUS_PENDING New sound instances that were created by events that had a "Start Sound Step". Note that these instances aren't audible yet, so that you have a chance to modify game driven properties (like the 3D position) - on the sound before Miles begins to play it. - + on the sound before Miles begins to play it. + $:MILESEVENT_SOUND_STATUS_PLAYING Sound instances that were previously started and are continuing to play (you might update the 3D position for these, for example). - + $:MILESEVENT_SOUND_STATUS_COMPLETE Sound instances that finished playing since the last this frame (you might use this status to free any game related memory, for example). - + These are the status values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. */ @@ -7360,13 +7360,13 @@ EXPTYPEBEGIN typedef U32 MILESEVENTSOUNDFLAG; EXPTYPEEND /* Specifies the status of a sound instance. - + $:MILESEVENT_SOUND_FLAG_MISSING_SOUND The event system tried to look up the sound requested from a Start Sound event and couldn't find anything in the loaded banks. $:MILESEVENT_SOUND_FLAG_EVICTED The sound was evicted due to a sound instance limit being hit. Another sound was selected as being higher priority, and this sound was stopped as a result. This can be the result of either a Label Sound Limit, or a limit on the sound itself. - $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. + $:MILESEVENT_SOUND_FLAG_WAITING_ASYNC The sound is pending because the data for it is currently being loaded. The sound will start when sufficient data has been loaded to hopefully avoid a skip. $:MILESEVENT_SONUD_FLAG_PENDING_ASYNC The sound has started playing, but the data still isn't completely loaded, and it's possible that the sound playback will catch up to the read position under poor I/O conditions. @@ -7375,7 +7375,7 @@ EXPTYPEEND sound data is asynchronously loaded, or specify the sound in a Cache Sounds step prior to attempting to start it. $:MILESEVENT_SOUND_FLAG_FAILED_ASYNC The sound tried to load and the asynchronous I/O operation failed - most likely either the media was removed during load, or the file was not found. - + These are the flag values that each sound instance can have. Use $AIL_enumerate_sound_instances to retrieve them. Instances may have more than one flag, logically 'or'ed together. */ @@ -7383,16 +7383,16 @@ EXPTYPEEND DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); /* Completes the queue processing (which is started with $AIL_begin_event_queue_processing ). - + $:return Returns 0 on failure. - This function must be called as a pair with $AIL_begin_event_queue_processing. - - In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't - started playing yet. Old sound instances that have finished playing are still valid - they - haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances + This function must be called as a pair with $AIL_begin_event_queue_processing. + + In $AIL_begin_event_queue_processing, all the new sound instances are queued up, but they haven't + started playing yet. Old sound instances that have finished playing are still valid - they + haven't been freed yet. $AIL_complete_event_queue_processing actually starts the sound instances and frees the completed ones - it's the 2nd half of the event processing. - + Usually you call $AIL_enumerate_sound_instances before this function to manage all the sound instances. */ @@ -7400,7 +7400,7 @@ DXDEC EXPAPI S32 AILCALL AIL_complete_event_queue_processing( void ); DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a stop sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to stop only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7408,7 +7408,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 Enqueues an event to stop all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to stop the necessary sounds, however, if a single sound (for example associated with an enemy that the player just killed) needs to be stopped, this function accomplishes that, and is captured by the auditioner for replay. @@ -7417,7 +7417,7 @@ DXDEC EXPAPI U64 AILCALL AIL_stop_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a pause sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to pause only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7425,7 +7425,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 Enqueues an event to pause all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to pause the necessary sounds, however, if a single sound (for example associated with an enemy that has been put in to stasis) needs to be paused, this function accomplishes that, and is captured by the auditioner for replay. @@ -7434,7 +7434,7 @@ DXDEC EXPAPI U64 AILCALL AIL_pause_sound_instances(char const * label_query, U64 DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U64 apply_to_ID); /* Allows the programmer to manually enqueue a resume sound event into the event system. - + $:label_query A query to match sound instance labels against. Use 0 to skip label matching. $:apply_to_ID An optional value returned from a previous $AIL_enqueue_event or $AIL_enumerate_sound_instances that tells Miles to resume only those instances who's QueuedID,InstanceID,or EventID matches this value. @@ -7442,17 +7442,17 @@ DXDEC EXPAPI U64 AILCALL AIL_resume_sound_instances(char const * label_query, U6 Enqueues an event to resume all sounds matching the specified label query (see $AIL_enumerate_sound_instances for a description of the label_query format). - + Usually the programmer should trigger a named event that the sound designed can fill out to resume the necessary sounds, however, if a single sound (for example associated with an enemy that has been restored from stasis) needs to be resumed, this function accomplishes that, and is captured by the auditioner for replay. */ -DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, +DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * sound, U8 loop_count, S32 should_stream, char const * labels, void* user_buffer, S32 user_buffer_len, S32 enqueue_flags ); /* Allows the programmer to manually enqueue a start sound event into the event system. - + $:bank The bank containing the sound to start. $:sound The name of the sound file to start, including bank name, e.g. "BankName/SoundName" $:loop_count The loop count to assign to the sound. 0 for infinite, 1 for play once, or just the number of times to loop. @@ -7463,10 +7463,10 @@ DXDEC EXPAPI U64 AILCALL AIL_start_sound_instance(HMSOUNDBANK bank, char const * $:enqueue_flags See the enqueue_flags description in $AIL_enqueue_event. $:return Returns a non-zero EnqueueID on success. - Enqueues an event to start the specified sound asset. - + Enqueues an event to start the specified sound asset. + Usually the programmer should trigger an event that the sound designer has specifically - create to start the appropriate sounds, but this function gives the programmer + create to start the appropriate sounds, but this function gives the programmer manual control, if necessary. This function is not captured by the auditioner. */ @@ -7488,7 +7488,7 @@ DXDEC EXPAPI S32 AILCALL AIL_set_sound_label_limits(HEVENTSYSTEM system, char co Every time an event triggers a sound to be played, the sound limits are checked, and, if exceeded, a sound is dropped (based on the settings in the event step). - + Usually event limits are set by a sound designer via an event, but this lets the programmer override the limits at runtime. Note that this replaces those events, it does not supplement. */ @@ -7503,7 +7503,7 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS that this pointer can change frame to frame and should be immediately copied to a client-allocated buffer if persistence is desired. $:return Returns 0 when enumeration is complete. - + This function lets you enumerate all the persisting presets that are currently active in the system. It is mostly a debugging aid. */ @@ -7511,12 +7511,12 @@ DXDEC EXPAPI S32 AILCALL AIL_enumerate_preset_persists(HEVENTSYSTEM system, HMSS DXDEC EXPAPI char * AILCALL AIL_text_dump_event_system(void); /* Returns a big string describing the current state of the event system. - - $:return String description of current systems state. + + $:return String description of current systems state. This function is a debugging aid - it can be used to show all of the active allocations, active sounds, etc. - + You must delete the pointer returned from this function with $AIL_mem_free_lock. */ @@ -7535,7 +7535,7 @@ EXPTYPE typedef struct _MILESEVENTSTATE } MILESEVENTSTATE; /* returns the current state of the Miles Event System. - + $:CommandBufferSize The size of the command buffer in bytes. See also the $AIL_startup_event_system. $:HeapSize The total size of memory used by the event system for management structures, and is allocated during startup. This does not include loaded file sizes. $:HeapRemaining The number of bytes in HeapSize that is remaining. @@ -7615,7 +7615,7 @@ EXPTYPE typedef struct _MILESBANKFUNCTIONS } MILESBANKFUNCTIONS; /* specifies callbacks for each of the Miles event system. - + $:FreeAll Callback that tells you to free all user-side bank memory. $:GetPreset Callback to retrieve a sound preset. $:GetEnvironment Callback to retrieve an environment preset. @@ -7645,13 +7645,13 @@ DXDEC EXPAPI void AILCALL AIL_set_event_sample_functions(HSAMPLE (*CreateSampleC In the callback, SoundName is the name of the asset in Miles Studio, and SoundFileName is the value returned from Container_GetSound() (see also $AIL_set_event_bank_functions). - + */ DXDEC EXPAPI void AILCALL AIL_set_event_bank_functions(MILESBANKFUNCTIONS const * Functions); /* Allows you to override the internal bank file resource management.. - + $:Functions A pointer to a structure containing all the callback functions. This function is used to completely override the high-level resource management system. @@ -7856,7 +7856,7 @@ EXPTYPEEND $:MILES_PLAT_IPHONE Apple iDevices $:MILES_PLAT_LINUX Linux Flavors $:MILES_PLAT_WII Nintendo Wii - $:MILES_PLAT_PSP2 Sony NGP + $:MILES_PLAT_PSP2 Sony NGP Values representing the various platforms the high level tool allows. */ @@ -7891,11 +7891,11 @@ EXPGROUP(Miles High Level Event System) DXDEC EXPAPI void AILCALL AIL_event_system_state(HEVENTSYSTEM system, MILESEVENTSTATE* state); /* Returns an information structure about the current state of the Miles Event System. - + $:system The system to retrieve information for, or zero for the default system. $:state A pointer to a structure to receive the state information. - This function is a debugging aid - it returns information for the event system. + This function is a debugging aid - it returns information for the event system. */ DXDEC EXPAPI U32 AILCALL AIL_event_system_command_queue_remaining(); @@ -7923,7 +7923,7 @@ DXDEC EXPAPI S32 AILCALL AIL_get_event_length(char const* i_EventName); // Callback for the error handler. EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_Resource); /* - The function prototype to use for a callback that will be made when the event system + The function prototype to use for a callback that will be made when the event system encounters an unrecoverable error. $:i_RelevantId The ID of the asset that encountered the error, as best known. EventID or SoundID. @@ -7937,7 +7937,7 @@ EXPAPI typedef void AILCALLBACK AILEVENTERRORCB(S64 i_RelevantId, char const* i_ EXPAPI typedef S32 AILCALLBACK MSS_USER_RAND( void ); /* The function definition to use when defining your own random function. - + You can define a function with this prototype and pass it to $AIL_register_random if you want to tie the Miles random calls in with your game's (for logging and such). */ @@ -7953,7 +7953,7 @@ DXDEC EXPAPI void AILCALL AIL_set_event_error_callback(AILEVENTERRORCB * i_Error can sometimes be somewhat invisible. This function allows you to see what went wrong, when it went wrong. - The basic usage is to have the callback check $AIL_last_error() for the overall category of + The basic usage is to have the callback check $AIL_last_error() for the overall category of failure. The parameter passed to the callback might provide some context, but it can and will be zero on occasion. Generally it will represent the resource string that is being worked on when the error occurred. @@ -8009,7 +8009,7 @@ typedef C8 * (AILCALL *FLT_ERROR)(void); typedef HDRIVERSTATE (AILCALL *FLT_OPEN_DRIVER) (MSS_ALLOC_TYPE * palloc, MSS_FREE_TYPE * pfree, - UINTa user, + UINTa user, HDIGDRIVER dig, void * memory); typedef FLTRESULT (AILCALL *FLT_CLOSE_DRIVER) (HDRIVERSTATE state); diff --git a/Minecraft.Client/Windows64/Miles/include/rrcore.h b/Minecraft.Client/Windows64/Miles/include/rrcore.h index e88b5f8c..17ebee3a 100644 --- a/Minecraft.Client/Windows64/Miles/include/rrcore.h +++ b/Minecraft.Client/Windows64/Miles/include/rrcore.h @@ -114,8 +114,8 @@ #define __RADLITTLEENDIAN__ #ifdef __i386__ #define __RADX86__ - #else - #define __RADARM__ + #else + #define __RADARM__ #endif #define RADINLINE inline #define RADRESTRICT __restrict @@ -132,7 +132,7 @@ #define __RADX86__ #else #error Unknown processor -#endif +#endif #define __RADLITTLEENDIAN__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -155,7 +155,7 @@ #define __RADNACL__ #define __RAD32__ #define __RADLITTLEENDIAN__ - #define __RADX86__ + #define __RADX86__ #define RADINLINE inline #define RADRESTRICT __restrict @@ -196,7 +196,7 @@ #define __RAD64REGS__ #define __RADLITTLEENDIAN__ #define RADINLINE inline - #define RADRESTRICT __restrict + #define RADRESTRICT __restrict #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) @@ -265,7 +265,7 @@ #endif #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) - + #elif defined(CAFE) // has to be before HOLLYWOOD_REV since it also defines it #define __RADWIIU__ @@ -480,7 +480,7 @@ #undef RADRESTRICT /* could have been defined above... */ #define RADRESTRICT __restrict - + #undef RADSTRUCT #define RADSTRUCT struct __attribute__((__packed__)) #endif @@ -885,7 +885,7 @@ #define RAD_ALIGN(type,var,num) type __declspec(align(num)) var #else // NOTE: / / is a guaranteed parse error in C/C++. - #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / + #define RAD_ALIGN(type,var,num) RAD_ALIGN_USED_BUT_NOT_DEFINED / / #endif // WARNING : RAD_TLS should really only be used for debug/tools stuff @@ -917,8 +917,8 @@ #define RAD_S32 signed int // But pointers are 64 bits. #if (_MSC_VER >= 1300 && defined(_Wp64) && _Wp64 ) - #define RAD_SINTa __w64 signed __int64 - #define RAD_UINTa __w64 unsigned __int64 + #define RAD_SINTa __w64 signed long long + #define RAD_UINTa __w64 unsigned long long #else // non-vc.net compiler or /Wp64 turned off #define RAD_UINTa unsigned long long #define RAD_SINTa signed long long @@ -976,8 +976,8 @@ #define RAD_U64 unsigned long long #define RAD_S64 signed long long #elif defined(__RADX64__) || defined(__RAD32__) - #define RAD_U64 unsigned __int64 - #define RAD_S64 signed __int64 + #define RAD_U64 unsigned long long + #define RAD_S64 signed long long #else // 16-bit typedef RADSTRUCT RAD_U64 // do this so that we don't accidentally use U64s @@ -1134,7 +1134,7 @@ // helpers for doing an if ( ) with expect : // if ( RAD_LIKELY(expr) ) { ... } - + #define RAD_LIKELY(expr) RAD_EXPECT(expr,1) #define RAD_UNLIKELY(expr) RAD_EXPECT(expr,0) @@ -1324,7 +1324,7 @@ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ } while(0) \ - __pragma(warning(pop)) + __pragma(warning(pop)) #define RAD_STATEMENT_END_TRUE \ __pragma(warning(push)) \ @@ -1333,10 +1333,10 @@ __pragma(warning(pop)) #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #else - #define RAD_USE_STANDARD_LOOP_CONSTRUCT + #define RAD_USE_STANDARD_LOOP_CONSTRUCT #endif #ifdef RAD_USE_STANDARD_LOOP_CONSTRUCT @@ -1345,7 +1345,7 @@ #define RAD_STATEMENT_END_FALSE \ } while ( (void)0,0 ) - + #define RAD_STATEMENT_END_TRUE \ } while ( (void)1,1 ) @@ -1355,7 +1355,7 @@ RAD_STATEMENT_START \ code \ RAD_STATEMENT_END_FALSE - + #define RAD_INFINITE_LOOP( code ) \ RAD_STATEMENT_START \ code \ @@ -1363,7 +1363,7 @@ // Must be placed after variable declarations for code compiled as .c -#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later +#if defined(_MSC_VER) && _MSC_VER >= 1700 // in 2012 aka 11.0 and later # define RR_UNUSED_VARIABLE(x) (void) x #else # define RR_UNUSED_VARIABLE(x) (void)(sizeof(x)) @@ -1473,7 +1473,7 @@ // just to make gcc shut up about derefing null : #define RR_MEMBER_OFFSET_PTR(type,member,ptr) ( (SINTa) &(((type *)(ptr))->member) - (SINTa)(ptr) ) #define RR_MEMBER_SIZE_PTR(type,member,ptr) ( sizeof( ((type *) (ptr))->member) ) - + // MEMBER_TO_OWNER takes a pointer to a member and gives you back the base of the object // you should then RR_ASSERT( &(ret->member) == ptr ); #define RR_MEMBER_TO_OWNER(type,member,ptr) (type *)( ((char *)(ptr)) - RR_MEMBER_OFFSET_PTR(type,member,ptr) ) @@ -1482,7 +1482,7 @@ // Cache / prefetch macros : // RR_PREFETCH for various platforms : -// +// // RR_PREFETCH_SEQUENTIAL : prefetch memory for reading in a sequential scan // platforms that automatically prefetch sequential (eg. PC) should be a no-op here // RR_PREFETCH_WRITE_INVALIDATE : prefetch memory for writing - contents of memory are undefined @@ -1707,7 +1707,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define rrDisplayAssertion(i,n,l,f,m) ( ( g_fp_rrDisplayAssertion ) ? (*g_fp_rrDisplayAssertion)(i,n,l,f,m) : 1 ) //----------------------------------------------------------- - + // RAD_NO_BREAK : option if you don't like your assert to break // CB : RR_BREAK is *always* a break ; RR_ASSERT_BREAK is optional #ifdef RAD_NO_BREAK @@ -1725,7 +1725,7 @@ extern fp_rrDisplayAssertion * g_fp_rrDisplayAssertion; #define RR_ASSERT_LITE_ALWAYS(exp) RAD_STATEMENT_WRAPPER( if ( ! (exp) ) { RR_ASSERT_BREAK(); } ) //----------------------------------- -#ifdef RR_DO_ASSERTS +#ifdef RR_DO_ASSERTS #define RR_ASSERT(exp) RR_ASSERT_ALWAYS(exp) #define RR_ASSERT_LITE(exp) RR_ASSERT_LITE_ALWAYS(exp) @@ -1883,7 +1883,7 @@ unsigned long __cdecl _byteswap_ulong (unsigned long _Long); #define RR_BSWAP16 _byteswap_ushort #define RR_BSWAP32 _byteswap_ulong -unsigned __int64 __cdecl _byteswap_uint64 (unsigned __int64 val); +unsigned long long __cdecl _byteswap_uint64 (unsigned long long val); #pragma intrinsic(_byteswap_uint64) #define RR_BSWAP64 _byteswap_uint64 @@ -1909,7 +1909,7 @@ RADFORCEINLINE unsigned long RR_BSWAP32 (unsigned long _Long) return _Long; } -RADFORCEINLINE unsigned __int64 RR_BSWAP64 (unsigned __int64 _Long) +RADFORCEINLINE unsigned long long RR_BSWAP64 (unsigned long long _Long) { __asm { mov eax, DWORD PTR _Long @@ -2250,10 +2250,10 @@ void __storewordbytereverse (unsigned int val, int offset, void *bas #if ( defined(_MSC_VER) && _MSC_VER >= 1300) -unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); +unsigned long long __cdecl _rotl64(unsigned long long _Val, int _Shift); #pragma intrinsic(_rotl64) -#define RR_ROTL64(x,k) _rotl64((unsigned __int64)(x),(int)(k)) +#define RR_ROTL64(x,k) _rotl64((unsigned long long)(x),(int)(k)) #elif defined(__RADCELL__) @@ -2262,7 +2262,7 @@ unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val, int _Shift); #elif defined(__RADLINUX__) || defined(__RADMACAPI__) -//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. +//APTODO: Just to compile linux. Should we be doing better than this? If not, combine with above. #define RR_ROTL64(u64,num) ( ( (u64) << (num) ) | ( (u64) >> (64 - (num))) ) #else diff --git a/Minecraft.Client/Windows64/Windows64_App.cpp b/Minecraft.Client/Windows64/Windows64_App.cpp index bba33cad..d5564804 100644 --- a/Minecraft.Client/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Windows64/Windows64_App.cpp @@ -76,7 +76,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart() StorageManager.SetSaveTitle(wWorldName.c_str()); bool isFlat = false; - __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 + 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 NetworkGameInitData *param = new NetworkGameInitData(); param->seed = seedValue; diff --git a/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h b/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h index 2988dc2c..2ba90566 100644 --- a/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h +++ b/Minecraft.Client/Xbox/4JLibs/inc/4J_Storage.h @@ -5,7 +5,7 @@ using namespace std; class CXuiStringTable; -typedef struct +typedef struct { FILETIME fTime; XCONTENT_DATA Content; @@ -34,7 +34,7 @@ class C4JStorage public: // Structs defined in the DLC_Creator, but added here to be used in the app - typedef struct + typedef struct { unsigned int uiFileSize; DWORD dwType; @@ -52,7 +52,7 @@ public: DLC_FILE_PARAM, *PDLC_FILE_PARAM; // End of DLC_Creator structs - typedef struct + typedef struct { WCHAR wchDisplayName[XCONTENT_MAX_DISPLAYNAME_LENGTH]; CHAR szFileName[XCONTENT_MAX_FILENAME_LENGTH]; @@ -62,7 +62,7 @@ public: CACHEINFOSTRUCT; // structure to hold DLC info in TMS - typedef struct + typedef struct { DWORD dwVersion; DWORD dwNewOffers; @@ -102,7 +102,7 @@ public: enum ESaveGameControlState { ESaveGameControl_Idle=0, - ESaveGameControl_Save, + ESaveGameControl_Save, ESaveGameControl_InternalRequestingDevice, ESaveGameControl_InternalGetSaveName, ESaveGameControl_InternalSaving, @@ -189,7 +189,7 @@ public: TMS_UGCTYPE_MAX }; - typedef struct + typedef struct { CHAR szFilename[256]; int iFileSize; @@ -197,14 +197,14 @@ public: } TMSPP_FILE_DETAILS, *PTMSPP_FILE_DETAILS; - typedef struct + typedef struct { int iCount; PTMSPP_FILE_DETAILS FileDetailsA; } TMSPP_FILE_LIST, *PTMSPP_FILE_LIST; - typedef struct + typedef struct { DWORD dwSize; PBYTE pbData; @@ -241,7 +241,7 @@ public: PVOID AllocateSaveData(unsigned int uiBytes); void SaveSaveData(unsigned int uiBytes,PBYTE pbThumbnail=NULL,DWORD cbThumbnail=0,PBYTE pbTextData=NULL, DWORD dwTextLen=0); void CopySaveDataToNewSave(PBYTE pbThumbnail,DWORD cbThumbnail,WCHAR *wchNewName,int ( *Func)(LPVOID lpParam, bool), LPVOID lpParam); - void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); + void SetSaveDeviceSelected(unsigned int uiPad,bool bSelected); bool GetSaveDeviceSelected(unsigned int iPad); C4JStorage::ELoadGameStatus DoesSaveExist(bool *pbExists); bool EnoughSpaceForAMinSaveGame(); @@ -260,13 +260,13 @@ public: // DLC void RegisterMarketplaceCountsCallback(int ( *Func)(LPVOID lpParam, C4JStorage::DLC_TMS_DETAILS *, int), LPVOID lpParam ); void SetDLCPackageRoot(char *pszDLCRoot); - C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); + C4JStorage::EDLCStatus GetDLCOffers(int iPad,int( *Func)(LPVOID, int, DWORD, int),LPVOID lpParam, DWORD dwOfferTypesBitmask=XMARKETPLACE_OFFERING_TYPE_CONTENT); DWORD CancelGetDLCOffers(); void ClearDLCOffers(); //XMARKETPLACE_CONTENTOFFER_INFO& GetOffer(DWORD dw); XMARKETPLACE_CURRENCY_CONTENTOFFER_INFO& GetOffer(DWORD dw); int GetOfferCount(); - DWORD InstallOffer(int iOfferIDC,unsigned __int64 *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); + DWORD InstallOffer(int iOfferIDC,uint64_t *ullOfferIDA,int( *Func)(LPVOID, int, int),LPVOID lpParam, bool bTrial=false); DWORD GetAvailableDLCCount( int iPad); C4JStorage::EDLCStatus GetInstalledDLC(int iPad,int( *Func)(LPVOID, int, int),LPVOID lpParam); @@ -297,7 +297,7 @@ public: HRESULT TMSPP_SetTitleGroupID(LPCSTR szGroupID); // #ifdef _DEBUG -// void SetSaveName(int i); +// void SetSaveName(int i); // #endif // string table for all the Storage problems. Loaded by the application CXuiStringTable *m_pStringTable; diff --git a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h index 6d1056ff..12876ea8 100644 --- a/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h +++ b/Minecraft.Client/Xbox/Sentient/Include/SenClientUGCTypes.h @@ -43,7 +43,7 @@ namespace Sentient }; typedef unsigned int SenUGCMetaDataFlags; - enum + enum { SenUGCMetaDataFlags_NoFlags = 0x00000000, SenUGCMetaDataFlags_FriendsCanEdit = 0x00000001, @@ -66,7 +66,7 @@ namespace Sentient #pragma warning ( disable : 4996 ) // @TODO - Removed once Int16 Descriptors are deprecated memset(descriptors, 0, sizeof(SenUGCDescriptor) * NrUgcDescriptors); #pragma warning ( default : 4996 ) - memset(descriptors2, 0, sizeof(__int64) * NrUgcDescriptors); + memset(descriptors2, 0, sizeof(int64_t) * NrUgcDescriptors); } SenUGCID parentID; @@ -80,10 +80,10 @@ namespace Sentient wchar_t shortName[ShortNameLength]; static const int NrUgcDescriptors = 4; - + __declspec(deprecated("Descriptors have increased in size (from Int16 to Int64). Please Use descriptors2 instead")) SenUGCDescriptor descriptors[NrUgcDescriptors]; - __int64 descriptors2[NrUgcDescriptors]; + int64_t descriptors2[NrUgcDescriptors]; static const int BlobSizeLimit = 1024; size_t metaDataBlobSize; @@ -160,10 +160,10 @@ namespace Sentient enum SenUGCSortBy { - SenUGCSortBy_CreationDate, - SenUGCSortBy_TopFavorites, - SenUGCSortBy_TopReviewScoreAverage, - SenUGCSortBy_TopDownloadsTotal + SenUGCSortBy_CreationDate, + SenUGCSortBy_TopFavorites, + SenUGCSortBy_TopReviewScoreAverage, + SenUGCSortBy_TopDownloadsTotal }; enum SenUGCAuthorType @@ -211,7 +211,7 @@ namespace Sentient }; // ***** Leaderboard types - typedef __int64 SenLeaderboardEntryValue; + typedef int64_t SenLeaderboardEntryValue; typedef ULONGLONG SenLeaderboardActorId; enum SenLeaderboardSortType @@ -224,7 +224,7 @@ namespace Sentient /// @brief Leaderboard Metadata retrieval flag. /// /// @details When retrieving Leaderboard information, a client can choose - /// to bypass retrieval or retrieve specific details regarding the + /// to bypass retrieval or retrieve specific details regarding the /// Metadata stored for a given Leaderboard or Leaderboard Entry. /// enum SenLeaderboardMetadataFlag diff --git a/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp b/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp index 5366e721..cfa92064 100644 --- a/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp +++ b/Minecraft.Client/Xbox/XML/ATGXmlParser.cpp @@ -1,13 +1,13 @@ -// 4J-PB - -// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). -// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. -// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. -// You are encouraged to incorporate this code into your titles. +// 4J-PB - +// The ATG Framework is a common set of C++ class libraries that is used by the samples in the XDK, and was developed by the Advanced Technology Group (ATG). +// The ATG Framework offers a clean and consistent format for the samples. These classes define functions used by all the samples. +// The ATG Framework together with the samples demonstrates best practices and innovative techniques for Xbox 360. There are many useful sections of code in the samples. +// You are encouraged to incorporate this code into your titles. //------------------------------------------------------------------------------------- // AtgXmlParser.cpp -// +// // Simple callback non-validating XML parser implementation. // // Xbox Advanced Technology Group. @@ -35,7 +35,7 @@ XMLParser::XMLParser() // Name: XMLParser::~XMLParser //------------------------------------------------------------------------------------- XMLParser::~XMLParser() -{ +{ } @@ -51,11 +51,11 @@ VOID XMLParser::FillBuffer() if( m_hFile == NULL ) { - if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) + if( m_uInXMLBufferCharsLeft > XML_READ_BUFFER_SIZE ) NChars = XML_READ_BUFFER_SIZE; else NChars = m_uInXMLBufferCharsLeft; - + CopyMemory( m_pReadBuf, m_pInXMLBuffer, NChars ); m_uInXMLBufferCharsLeft -= NChars; m_pInXMLBuffer += NChars; @@ -69,7 +69,7 @@ VOID XMLParser::FillBuffer() } m_dwCharsConsumed += NChars; - __int64 iProgress = m_dwCharsTotal ? (( (__int64)m_dwCharsConsumed * 1000 ) / (__int64)m_dwCharsTotal) : 0; + int64_t iProgress = m_dwCharsTotal ? (( (int64_t)m_dwCharsConsumed * 1000 ) / (int64_t)m_dwCharsTotal) : 0; m_pISAXCallback->SetParseProgress( (DWORD)iProgress ); m_pReadBuf[ NChars ] = '\0'; @@ -89,7 +89,7 @@ VOID XMLParser::SkipNextAdvance() //------------------------------------------------------------------------------------- // Name: XMLParser::ConsumeSpace -// Desc: Skips spaces in the current stream +// Desc: Skips spaces in the current stream //------------------------------------------------------------------------------------- HRESULT XMLParser::ConsumeSpace() { @@ -104,29 +104,29 @@ HRESULT XMLParser::ConsumeSpace() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - } - SkipNextAdvance(); + } + SkipNextAdvance(); return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::ConvertEscape -// Desc: Copies and converts an escape sequence into m_pWriteBuf +// Desc: Copies and converts an escape sequence into m_pWriteBuf //------------------------------------------------------------------------------------- HRESULT XMLParser::ConvertEscape() -{ +{ HRESULT hr; WCHAR wVal = 0; - + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - // all escape sequences start with &, so ignore the first character - + // all escape sequences start with &, so ignore the first character + if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if ( m_Ch == '#' ) // character as hex or decimal { if( FAILED( hr = AdvanceCharacter() ) ) @@ -135,9 +135,9 @@ HRESULT XMLParser::ConvertEscape() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + while ( m_Ch != ';' ) - { + { wVal *= 16; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -151,11 +151,11 @@ HRESULT XMLParser::ConvertEscape() else if ( ( m_Ch >= 'A' ) && ( m_Ch <= 'F' ) ) { wVal += m_Ch - 'A' + 10; - } + } else { - Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Expected hex digit as part of &#x escape sequence" ); + return E_INVALID_XML_SYNTAX; } if( FAILED( hr = AdvanceCharacter() ) ) @@ -165,7 +165,7 @@ HRESULT XMLParser::ConvertEscape() else // decimal number { while ( m_Ch != ';' ) - { + { wVal *= 10; if ( ( m_Ch >= '0' ) && ( m_Ch <= '9' ) ) @@ -174,7 +174,7 @@ HRESULT XMLParser::ConvertEscape() } else { - Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); + Error( E_INVALID_XML_SYNTAX, "Expected decimal digit as part of &# escape sequence" ); return E_INVALID_XML_SYNTAX; } @@ -187,7 +187,7 @@ HRESULT XMLParser::ConvertEscape() m_Ch = wVal; return S_OK; - } + } // must be an entity reference @@ -197,13 +197,13 @@ HRESULT XMLParser::ConvertEscape() SkipNextAdvance(); if( FAILED( hr = AdvanceName() ) ) return hr; - + EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); m_pWritePtr = pEntityRefVal; if ( EntityRefLen == 0 ) { - Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); + Error( E_INVALID_XML_SYNTAX, "Expecting entity name after &" ); return E_INVALID_XML_SYNTAX; } @@ -219,7 +219,7 @@ HRESULT XMLParser::ConvertEscape() wVal = '"'; else { - Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); + Error( E_INVALID_XML_SYNTAX, "Unrecognized entity name after & - (should be lt, gt, amp, apos, or quot)" ); return E_INVALID_XML_SYNTAX; // return false if unrecognized token sequence } @@ -228,10 +228,10 @@ HRESULT XMLParser::ConvertEscape() if( m_Ch != ';' ) { - Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); + Error( E_INVALID_XML_SYNTAX, "Expected terminating ; for entity reference" ); return E_INVALID_XML_SYNTAX; // malformed reference - needs terminating ; } - + m_Ch = wVal; return S_OK; } @@ -250,41 +250,41 @@ HRESULT XMLParser::AdvanceAttrVal() return hr; if( ( m_Ch != '"' ) && ( m_Ch != '\'' ) ) - { - Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); + { + Error( E_INVALID_XML_SYNTAX, "Attribute values must be enclosed in quotes" ); return E_INVALID_XML_SYNTAX; } wQuoteChar = m_Ch; - + for( ;; ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - else if( m_Ch == wQuoteChar ) - break; + return hr; + else if( m_Ch == wQuoteChar ) + break; else if( m_Ch == '&' ) { SkipNextAdvance(); if( FAILED( hr = ConvertEscape() ) ) - return hr; + return hr; } - else if( m_Ch == '<' ) + else if( m_Ch == '<' ) { - Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Illegal character '<' in element tag" ); + return E_INVALID_XML_SYNTAX; } - + // copy character into the buffer - - if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) + + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + return E_INVALID_XML_SYNTAX; } - + *m_pWritePtr = m_Ch; - m_pWritePtr++; + m_pWritePtr++; } return S_OK; } @@ -296,18 +296,18 @@ HRESULT XMLParser::AdvanceAttrVal() // Ignores leading whitespace. Currently does not support unicode names //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceName() -{ +{ HRESULT hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( ( ( m_Ch < 'A' ) || ( m_Ch > 'Z' ) ) && ( ( m_Ch < 'a' ) || ( m_Ch > 'z' ) ) && ( m_Ch != '_' ) && ( m_Ch != ':' ) ) { - Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Names must start with an alphabetic character or _ or :" ); + return E_INVALID_XML_SYNTAX; } while( ( ( m_Ch >= 'A' ) && ( m_Ch <= 'Z' ) ) || @@ -319,17 +319,17 @@ HRESULT XMLParser::AdvanceName() if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { - Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); + Error( E_INVALID_XML_SYNTAX, "Total element tag size may not be more than %d characters", XML_WRITE_BUFFER_SIZE ); return E_INVALID_XML_SYNTAX; - } + } *m_pWritePtr = m_Ch; m_pWritePtr++; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } - + SkipNextAdvance(); return S_OK; } @@ -343,7 +343,7 @@ HRESULT XMLParser::AdvanceName() // Returns S_OK if there are more characters, E_ABORT for no characters to read //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) -{ +{ if( m_bSkipNextAdvance ) { m_bSkipNextAdvance = FALSE; @@ -351,20 +351,20 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } // If we hit EOF in the middle of a character, - // it's ok-- we'll just have a corrupt last character + // it's ok-- we'll just have a corrupt last character // (the buffer is padded with double NULLs ) if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { // Read more from the file - FillBuffer(); + FillBuffer(); // We are at EOF if it is still NULL if ( ( m_pReadPtr[0] == '\0' ) && ( m_pReadPtr[1] == '\0' ) ) { if( !bOkToFail ) { - Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); + Error( E_INVALID_XML_SYNTAX, "Unexpected EOF while parsing XML file" ); return E_INVALID_XML_SYNTAX; } else @@ -372,7 +372,7 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) return E_FAIL; } } - } + } if( m_bUnicode == FALSE ) { @@ -382,13 +382,13 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) else // if( m_bUnicode == TRUE ) { m_Ch = *((WCHAR *)m_pReadPtr); - + if( m_bReverseBytes ) { m_Ch = ( m_Ch << 8 ) + ( m_Ch >> 8 ); } - - m_pReadPtr += 2; + + m_pReadPtr += 2; } if( m_Ch == '\n' ) @@ -398,114 +398,114 @@ HRESULT XMLParser::AdvanceCharacter( BOOL bOkToFail ) } else if( m_Ch != '\r' ) m_pISAXCallback->m_LinePos++; - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::AdvanceElement -// Desc: Builds data, calls callback +// Desc: Builds data, calls callback //------------------------------------------------------------------------------------- HRESULT XMLParser::AdvanceElement() -{ +{ HRESULT hr; // write ptr at the beginning of the buffer m_pWritePtr = m_pWriteBuf; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // if first character wasn't '<', we wouldn't be here - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch == '!' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if ( m_Ch == '-' ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - if( m_Ch != '-' ) + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if( m_Ch != '-' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '-' after 'ElementEnd( pEntityRefVal, + if( FAILED( m_pISAXCallback->ElementEnd( pEntityRefVal, (UINT) ( m_pWritePtr - pEntityRefVal ) ) ) ) return E_ABORT; - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; if( m_Ch != '>' ) { @@ -513,42 +513,42 @@ HRESULT XMLParser::AdvanceElement() return E_INVALID_XML_SYNTAX; } } - else if( m_Ch == '?' ) + else if( m_Ch == '?' ) { // just skip any xml header tag since not really important after identifying character set for( ;; ) { - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; + if ( m_Ch == '>' ) return S_OK; } } else { - XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; + XMLAttribute Attributes[ XML_MAX_ATTRIBUTES_PER_ELEMENT ]; UINT NumAttrs; WCHAR *pEntityRefVal = m_pWritePtr; UINT EntityRefLen; NumAttrs = 0; - + SkipNextAdvance(); // Entity tag - if( FAILED( hr = AdvanceName() ) ) + if( FAILED( hr = AdvanceName() ) ) return hr; EntityRefLen = (UINT)( m_pWritePtr - pEntityRefVal ); - if( FAILED( hr = ConsumeSpace() ) ) + if( FAILED( hr = ConsumeSpace() ) ) return hr; - + if( FAILED( hr = AdvanceCharacter() ) ) - return hr; - + return hr; + // read attributes while( ( m_Ch != '>' ) && ( m_Ch != '/' ) ) { @@ -556,31 +556,31 @@ HRESULT XMLParser::AdvanceElement() if ( NumAttrs >= XML_MAX_ATTRIBUTES_PER_ELEMENT ) { - Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); - return E_INVALID_XML_SYNTAX; + Error( E_INVALID_XML_SYNTAX, "Elements may not have more than %d attributes", XML_MAX_ATTRIBUTES_PER_ELEMENT ); + return E_INVALID_XML_SYNTAX; } Attributes[ NumAttrs ].strName = m_pWritePtr; - + // Attribute name if( FAILED( hr = AdvanceName() ) ) return hr; - + Attributes[ NumAttrs ].NameLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strName ); if( FAILED( hr = ConsumeSpace() ) ) return hr; - if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + if( FAILED( hr = AdvanceCharacter() ) ) + return hr; - if( m_Ch != '=' ) + if( m_Ch != '=' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '=' character after attribute name" ); return E_INVALID_XML_SYNTAX; } - - if( FAILED( hr = ConsumeSpace() ) ) + + if( FAILED( hr = ConsumeSpace() ) ) return hr; Attributes[ NumAttrs ].strValue = m_pWritePtr; @@ -588,29 +588,29 @@ HRESULT XMLParser::AdvanceElement() if( FAILED( hr = AdvanceAttrVal() ) ) return hr; - Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - + Attributes[ NumAttrs ].ValueLen = (UINT)( m_pWritePtr - Attributes[ NumAttrs ].strValue ); ++NumAttrs; - + if( FAILED( hr = ConsumeSpace() ) ) - return hr; + return hr; if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; } if( m_Ch == '/' ) { if( FAILED( hr = AdvanceCharacter() ) ) - return hr; + return hr; if( m_Ch != '>' ) { Error( E_INVALID_XML_SYNTAX, "Expecting '>' after '/' in element tag" ); return E_INVALID_XML_SYNTAX; } - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; @@ -619,7 +619,7 @@ HRESULT XMLParser::AdvanceElement() } else { - if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, + if( FAILED( m_pISAXCallback->ElementBegin( pEntityRefVal, EntityRefLen, Attributes, NumAttrs ) ) ) return E_ABORT; } @@ -637,7 +637,7 @@ HRESULT XMLParser::AdvanceCDATA() { HRESULT hr; WORD wStage = 0; - + if( FAILED( m_pISAXCallback->CDATABegin() ) ) return E_ABORT; @@ -645,10 +645,10 @@ HRESULT XMLParser::AdvanceCDATA() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( ( m_Ch == ']' ) && ( wStage == 0 ) ) wStage = 1; else if( ( m_Ch == ']' ) && ( wStage == 1 ) ) @@ -666,9 +666,9 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) return E_ABORT; m_pWritePtr = m_pWriteBuf; - } + } } - + if( FAILED( m_pISAXCallback->CDATAData( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) return E_ABORT; @@ -676,7 +676,7 @@ HRESULT XMLParser::AdvanceCDATA() if( FAILED( m_pISAXCallback->CDATAEnd() ) ) return E_ABORT; - + return S_OK; } @@ -694,24 +694,24 @@ HRESULT XMLParser::AdvanceComment() { if( FAILED( hr = AdvanceCharacter() ) ) return hr; - + if (( m_Ch == '-' ) && ( wStage == 0 )) wStage = 1; else if (( m_Ch == '-' ) && ( wStage == 1 )) wStage = 2; - else if (( m_Ch == '>' ) && ( wStage == 2 )) - break; + else if (( m_Ch == '>' ) && ( wStage == 2 )) + break; else - wStage = 0; + wStage = 0; } - + return S_OK; } //------------------------------------------------------------------------------------- // Name: XMLParser::RegisterSAXCallbackInterface -// Desc: Registers callback interface +// Desc: Registers callback interface //------------------------------------------------------------------------------------- VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) { @@ -721,7 +721,7 @@ VOID XMLParser::RegisterSAXCallbackInterface( ISAXCallback *pISAXCallback ) //------------------------------------------------------------------------------------- // Name: XMLParser::GetSAXCallbackInterface -// Desc: Returns current callback interface +// Desc: Returns current callback interface //------------------------------------------------------------------------------------- ISAXCallback* XMLParser::GetSAXCallbackInterface() { @@ -740,7 +740,7 @@ HRESULT XMLParser::MainParseLoop() if( FAILED( m_pISAXCallback->StartDocument() ) ) return E_ABORT; - + m_pWritePtr = m_pWriteBuf; FillBuffer(); @@ -751,57 +751,57 @@ HRESULT XMLParser::MainParseLoop() m_bReverseBytes = FALSE; m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) + else if ( *((WCHAR *) m_pReadBuf ) == 0xFFFE ) { m_bUnicode = TRUE; m_bReverseBytes = TRUE; - m_pReadPtr += 2; + m_pReadPtr += 2; } - else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) - { - m_bUnicode = TRUE; - m_bReverseBytes = FALSE; - } - else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + else if ( *((WCHAR *) m_pReadBuf ) == 0x003C ) { m_bUnicode = TRUE; - m_bReverseBytes = TRUE; + m_bReverseBytes = FALSE; + } + else if ( *((WCHAR *) m_pReadBuf ) == 0x3C00 ) + { + m_bUnicode = TRUE; + m_bReverseBytes = TRUE; } else if ( m_pReadBuf[ 0 ] == 0x3C ) { - m_bUnicode = FALSE; - m_bReverseBytes = FALSE; + m_bUnicode = FALSE; + m_bReverseBytes = FALSE; } else - { + { Error( E_INVALID_XML_SYNTAX, "Unrecognized encoding (parser does not support UTF-8 language encodings)" ); - return E_INVALID_XML_SYNTAX; + return E_INVALID_XML_SYNTAX; } - + for( ;; ) { if( FAILED( AdvanceCharacter( TRUE ) ) ) { if ( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } - + if( FAILED( m_pISAXCallback->EndDocument() ) ) return E_ABORT; - - return S_OK; + + return S_OK; } if( m_Ch == '<' ) { if( ( (UINT) ( m_pWritePtr - m_pWriteBuf ) != 0 ) && ( !bWhiteSpaceOnly ) ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) - return E_ABORT; + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, (UINT)( m_pWritePtr - m_pWriteBuf ), FALSE ) ) ) + return E_ABORT; bWhiteSpaceOnly = TRUE; } @@ -810,45 +810,45 @@ HRESULT XMLParser::MainParseLoop() m_pWritePtr = m_pWriteBuf; - if( FAILED( hr = AdvanceElement() ) ) - return hr; + if( FAILED( hr = AdvanceElement() ) ) + return hr; m_pWritePtr = m_pWriteBuf; } - else + else { if( m_Ch == '&' ) { SkipNextAdvance(); - if( FAILED( hr = ConvertEscape() ) ) - return hr; + if( FAILED( hr = ConvertEscape() ) ) + return hr; } - if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && - ( m_Ch != '\t' ) ) + if( bWhiteSpaceOnly && ( m_Ch != ' ' ) && ( m_Ch != '\n' ) && ( m_Ch != '\r' ) && + ( m_Ch != '\t' ) ) { bWhiteSpaceOnly = FALSE; } *m_pWritePtr = m_Ch; m_pWritePtr++; - + if( m_pWritePtr - m_pWriteBuf >= XML_WRITE_BUFFER_SIZE ) { if( !bWhiteSpaceOnly ) - { - if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, - ( UINT ) ( m_pWritePtr - m_pWriteBuf ), + { + if( FAILED( m_pISAXCallback->ElementContent( m_pWriteBuf, + ( UINT ) ( m_pWritePtr - m_pWriteBuf ), TRUE ) ) ) { - return E_ABORT; + return E_ABORT; } } m_pWritePtr = m_pWriteBuf; bWhiteSpaceOnly = TRUE; } - } + } } } @@ -858,31 +858,31 @@ HRESULT XMLParser::MainParseLoop() // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) -{ +{ HRESULT hr; if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = strFilename; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; - m_pReadPtr = m_pReadBuf; - + m_pReadPtr = m_pReadBuf; + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; - + m_pReadBuf[ 1 ] = '\0'; + m_pInXMLBuffer = NULL; m_uInXMLBufferCharsLeft = 0; - m_hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); + m_hFile = CreateFile( strFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL ); if( m_hFile == INVALID_HANDLE_VALUE ) - { + { Error( E_COULD_NOT_OPEN_FILE, "Error opening file" ); hr = E_COULD_NOT_OPEN_FILE; - + } else { @@ -892,14 +892,14 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) m_dwCharsConsumed = 0; hr = MainParseLoop(); } - + // Close the file if( m_hFile != INVALID_HANDLE_VALUE ) CloseHandle( m_hFile ); m_hFile = INVALID_HANDLE_VALUE; // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } @@ -909,38 +909,38 @@ HRESULT XMLParser::ParseXMLFile( CONST CHAR *strFilename ) // Desc: Builds element data //------------------------------------------------------------------------------------- HRESULT XMLParser::ParseXMLBuffer( CONST CHAR *strBuffer, UINT uBufferSize ) -{ +{ HRESULT hr; - + if( m_pISAXCallback == NULL ) return E_NOINTERFACE; - m_pISAXCallback->m_LineNum = 1; + m_pISAXCallback->m_LineNum = 1; m_pISAXCallback->m_LinePos = 0; m_pISAXCallback->m_strFilename = ""; // save this off only while we parse the file m_bSkipNextAdvance = FALSE; m_pReadPtr = m_pReadBuf; - + m_pReadBuf[ 0 ] = '\0'; - m_pReadBuf[ 1 ] = '\0'; + m_pReadBuf[ 1 ] = '\0'; m_hFile = NULL; m_pInXMLBuffer = strBuffer; m_uInXMLBufferCharsLeft = uBufferSize; m_dwCharsTotal = uBufferSize; m_dwCharsConsumed = 0; - + hr = MainParseLoop(); // we no longer own strFilename, so un-set it - m_pISAXCallback->m_strFilename = NULL; + m_pISAXCallback->m_strFilename = NULL; return hr; } //------------------------------------------------------------------------------------- -// XMLParser::Error() +// XMLParser::Error() // Logs an error through the callback interface //------------------------------------------------------------------------------------- #ifdef _Printf_format_string_ // VC++ 2008 and later support this annotation @@ -955,7 +955,7 @@ VOID XMLParser::Error( HRESULT hErr, CONST CHAR* strFormat, ... ) va_start( pArglist, strFormat ); vsprintf( strBuffer, strFormat, pArglist ); - + m_pISAXCallback->Error( hErr, strBuffer ); va_end( pArglist ); } diff --git a/Minecraft.Client/stdafx.h b/Minecraft.Client/stdafx.h index 05b17e81..06802d4a 100644 --- a/Minecraft.Client/stdafx.h +++ b/Minecraft.Client/stdafx.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include "PSVitaTypes.h" #include "PSVitaStubs.h" @@ -59,7 +59,7 @@ #include #include #include -typedef unsigned __int64 __uint64; +#include #endif #ifdef _WINDOWS64 @@ -72,7 +72,7 @@ typedef unsigned __int64 __uint64; // TODO: reference additional headers your program requires here #include #include -using namespace DirectX; +using namespace DirectX; #define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) @@ -87,7 +87,7 @@ using namespace DirectX; #include #include #include -using namespace DirectX; +using namespace DirectX; #include #include "DurangoStubs.h" #define HRESULT_SUCCEEDED(hr) (((HRESULT)(hr)) >= 0) @@ -182,12 +182,12 @@ typedef XUID GameSessionUID; #include "Windows64\4JLibs\inc\4J_Storage.h" #include "Windows64\KeyboardMouseInput.h" #elif defined __PSVITA__ - #include "PSVita\4JLibs\inc\4J_Input.h" + #include "PSVita\4JLibs\inc\4J_Input.h" #include "PSVita\4JLibs\inc\4J_Profile.h" #include "PSVita\4JLibs\inc\4J_Render.h" #include "PSVita\4JLibs\inc\4J_Storage.h" #else - #include "Orbis\4JLibs\inc\4J_Input.h" + #include "Orbis\4JLibs\inc\4J_Input.h" #include "Orbis\4JLibs\inc\4J_Profile.h" #include "Orbis\4JLibs\inc\4J_Render.h" #include "Orbis\4JLibs\inc\4J_Storage.h" @@ -258,7 +258,7 @@ typedef XUID GameSessionUID; #include "Durango\Sentient\MinecraftTelemetry.h" #include "DurangoMedia\strings.h" #include "Durango\Durango_App.h" - #include "Durango\Sentient\DynamicConfigurations.h" + #include "Durango\Sentient\DynamicConfigurations.h" #include "Durango\Sentient\TelemetryEnum.h" #include "Durango\Sentient\SentientTelemetryCommon.h" #include "Durango\PresenceIds.h" @@ -276,7 +276,7 @@ typedef XUID GameSessionUID; #include "Windows64\Sentient\DynamicConfigurations.h" #include "Windows64\Sentient\SentientTelemetryCommon.h" #include "Windows64\GameConfig\Minecraft.spa.h" - #include "Windows64\XML\ATGXmlParser.h" + #include "Windows64\XML\ATGXmlParser.h" #include "Windows64\Social\SocialManager.h" #include "Common\Audio\SoundEngine.h" #include "Windows64\Iggy\include\iggy.h" @@ -303,7 +303,7 @@ typedef XUID GameSessionUID; #include "Orbis\Sentient\DynamicConfigurations.h" #include "Orbis\GameConfig\Minecraft.spa.h" #include "OrbisMedia\4J_strings.h" - #include "Orbis\XML\ATGXmlParser.h" + #include "Orbis\XML\ATGXmlParser.h" #include "Windows64\Social\SocialManager.h" #include "Common\Audio\SoundEngine.h" #include "Orbis\Iggy\include\iggy.h" diff --git a/Minecraft.World/AddIslandLayer.cpp b/Minecraft.World/AddIslandLayer.cpp index 21e9a96d..a8842936 100644 --- a/Minecraft.World/AddIslandLayer.cpp +++ b/Minecraft.World/AddIslandLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddIslandLayer::AddIslandLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +AddIslandLayer::AddIslandLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddIslandLayer.h b/Minecraft.World/AddIslandLayer.h index e7c9384b..2446bbf8 100644 --- a/Minecraft.World/AddIslandLayer.h +++ b/Minecraft.World/AddIslandLayer.h @@ -5,7 +5,7 @@ class AddIslandLayer : public Layer { public: - AddIslandLayer(__int64 seedMixup, shared_ptrparent); + AddIslandLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddMushroomIslandLayer.cpp b/Minecraft.World/AddMushroomIslandLayer.cpp index 022a3b29..324c88ee 100644 --- a/Minecraft.World/AddMushroomIslandLayer.cpp +++ b/Minecraft.World/AddMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -AddMushroomIslandLayer::AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddMushroomIslandLayer::AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddMushroomIslandLayer.h b/Minecraft.World/AddMushroomIslandLayer.h index acda9fa7..f691ebda 100644 --- a/Minecraft.World/AddMushroomIslandLayer.h +++ b/Minecraft.World/AddMushroomIslandLayer.h @@ -4,6 +4,6 @@ class AddMushroomIslandLayer : public Layer { public: - AddMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + AddMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/AddSnowLayer.cpp b/Minecraft.World/AddSnowLayer.cpp index d8a33cc9..aa459789 100644 --- a/Minecraft.World/AddSnowLayer.cpp +++ b/Minecraft.World/AddSnowLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -AddSnowLayer::AddSnowLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +AddSnowLayer::AddSnowLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/AddSnowLayer.h b/Minecraft.World/AddSnowLayer.h index ede7a226..0b3702da 100644 --- a/Minecraft.World/AddSnowLayer.h +++ b/Minecraft.World/AddSnowLayer.h @@ -4,6 +4,6 @@ class AddSnowLayer : public Layer { public: - AddSnowLayer(__int64 seedMixup, shared_ptr parent); + AddSnowLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BasicTree.cpp b/Minecraft.World/BasicTree.cpp index 01f10cb3..c1c92287 100644 --- a/Minecraft.World/BasicTree.cpp +++ b/Minecraft.World/BasicTree.cpp @@ -524,7 +524,7 @@ bool BasicTree::place(Level *level, Random *random, int x, int y, int z) // Initialize the instance fields for the level and the seed. thisLevel = level; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); rnd->setSeed(seed); // Initialize the origin of the tree trunk origin[0] = x; diff --git a/Minecraft.World/BasicTypeContainers.h b/Minecraft.World/BasicTypeContainers.h index 094e9616..8a139e3e 100644 --- a/Minecraft.World/BasicTypeContainers.h +++ b/Minecraft.World/BasicTypeContainers.h @@ -57,14 +57,14 @@ public: } static bool isInfinite( double a ) { return false; /*4J TODO*/ } - static double longBitsToDouble( __int64 bits ) + static double longBitsToDouble( int64_t bits ) { return *(double *)&bits; } - static __int64 doubleToLongBits( double d ) + static int64_t doubleToLongBits( double d ) { - return *(__int64 *)&d; + return *(int64_t *)&d; } }; diff --git a/Minecraft.World/BiomeCache.cpp b/Minecraft.World/BiomeCache.cpp index 0d9c017c..3ef4f0f6 100644 --- a/Minecraft.World/BiomeCache.cpp +++ b/Minecraft.World/BiomeCache.cpp @@ -85,7 +85,7 @@ BiomeCache::Block *BiomeCache::getBlockAt(int x, int z) EnterCriticalSection(&m_CS); x >>= ZONE_SIZE_BITS; z >>= ZONE_SIZE_BITS; - __int64 slot = (((__int64) x) & 0xffffffffl) | ((((__int64) z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) x) & 0xffffffffl) | ((((int64_t) z) & 0xffffffffl) << 32l); AUTO_VAR(it, cached.find(slot)); Block *block = NULL; if (it == cached.end()) @@ -124,8 +124,8 @@ float BiomeCache::getDownfall(int x, int z) void BiomeCache::update() { EnterCriticalSection(&m_CS); - __int64 now = app.getAppTime(); - __int64 utime = now - lastUpdateTime; + int64_t now = app.getAppTime(); + int64_t utime = now - lastUpdateTime; if (utime > DECAY_TIME / 4 || utime < 0) { lastUpdateTime = now; @@ -133,11 +133,11 @@ void BiomeCache::update() for (AUTO_VAR(it, all.begin()); it != all.end();) { Block *block = *it; - __int64 time = now - block->lastUse; + int64_t time = now - block->lastUse; if (time > DECAY_TIME || time < 0) { it = all.erase(it); - __int64 slot = (((__int64) block->x) & 0xffffffffl) | ((((__int64) block->z) & 0xffffffffl) << 32l); + int64_t slot = (((int64_t) block->x) & 0xffffffffl) | ((((int64_t) block->z) & 0xffffffffl) << 32l); cached.erase(slot); delete block; } diff --git a/Minecraft.World/BiomeCache.h b/Minecraft.World/BiomeCache.h index bf509f54..b2593ce3 100644 --- a/Minecraft.World/BiomeCache.h +++ b/Minecraft.World/BiomeCache.h @@ -10,7 +10,7 @@ private: static const int ZONE_SIZE_MASK = ZONE_SIZE - 1; const BiomeSource *source; - __int64 lastUpdateTime; + int64_t lastUpdateTime; public: class Block @@ -22,7 +22,7 @@ public: // BiomeArray biomes; byteArray biomeIndices; int x, z; - __int64 lastUse; + int64_t lastUse; Block(int x, int z, BiomeCache *parent); ~Block(); @@ -32,7 +32,7 @@ public: }; private: - unordered_map<__int64,Block *,LongKeyHash,LongKeyEq> cached; // 4J - was LongHashMap + unordered_map cached; // 4J - was LongHashMap vector all; // was ArrayList public: diff --git a/Minecraft.World/BiomeInitLayer.cpp b/Minecraft.World/BiomeInitLayer.cpp index ead63eee..6edd18de 100644 --- a/Minecraft.World/BiomeInitLayer.cpp +++ b/Minecraft.World/BiomeInitLayer.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.h" #include "BiomeInitLayer.h" -BiomeInitLayer::BiomeInitLayer(__int64 seed, shared_ptrparent, LevelType *levelType) : Layer(seed) +BiomeInitLayer::BiomeInitLayer(int64_t seed, shared_ptrparent, LevelType *levelType) : Layer(seed) { this->parent = parent; diff --git a/Minecraft.World/BiomeInitLayer.h b/Minecraft.World/BiomeInitLayer.h index e645a379..00bf3812 100644 --- a/Minecraft.World/BiomeInitLayer.h +++ b/Minecraft.World/BiomeInitLayer.h @@ -10,7 +10,7 @@ private: BiomeArray startBiomes; public: - BiomeInitLayer(__int64 seed, shared_ptr parent, LevelType *levelType); + BiomeInitLayer(int64_t seed, shared_ptr parent, LevelType *levelType); virtual ~BiomeInitLayer(); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/BiomeSource.cpp b/Minecraft.World/BiomeSource.cpp index b16efd31..9f03cc15 100644 --- a/Minecraft.World/BiomeSource.cpp +++ b/Minecraft.World/BiomeSource.cpp @@ -10,10 +10,10 @@ // 4J - removal of separate temperature & downfall layers brought forward from 1.2.3 void BiomeSource::_init() -{ +{ layer = nullptr; zoomedLayer = nullptr; - + cache = new BiomeCache(this); playerSpawnBiomes.push_back(Biome::forest); @@ -26,7 +26,7 @@ void BiomeSource::_init() playerSpawnBiomes.push_back(Biome::jungleHills); } -void BiomeSource::_init(__int64 seed, LevelType *generator) +void BiomeSource::_init(int64_t seed, LevelType *generator) { _init(); @@ -43,7 +43,7 @@ BiomeSource::BiomeSource() } // 4J added -BiomeSource::BiomeSource(__int64 seed, LevelType *generator) +BiomeSource::BiomeSource(int64_t seed, LevelType *generator) { _init(seed, generator); } @@ -271,7 +271,7 @@ void BiomeSource::getBiomeIndexBlock(byteArray& biomeIndices, int x, int z, int /** * Checks if an area around a block contains only the specified biomes. * Useful for placing elements like towns. -* +* * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -298,7 +298,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, vector allowed) /** * Checks if an area around a block contains only the specified biome. * Useful for placing elements like towns. -* +* * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -308,7 +308,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, Biome *allowed) int z0 = ((z - r) >> 2); int x1 = ((x + r) >> 2); int z1 = ((z + r) >> 2); - + int w = x1 - x0; int h = z1 - z0; int biomesCount = w*h; @@ -325,7 +325,7 @@ bool BiomeSource::containsOnly(int x, int z, int r, Biome *allowed) /** * Finds the specified biome within the radius. This will return a random * position if several are found. This test is fairly rough. -* +* * Returns null if the biome wasn't found */ TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *random) @@ -362,7 +362,7 @@ TilePos *BiomeSource::findBiome(int x, int z, int r, Biome *toFind, Random *rand /** * Finds one of the specified biomes within the radius. This will return a * random position if several are found. This test is fairly rough. -* +* * Returns null if the biome wasn't found */ TilePos *BiomeSource::findBiome(int x, int z, int r, vector allowed, Random *random) @@ -408,13 +408,13 @@ void BiomeSource::update() // 4J added - find a seed for this biomesource that matches certain criteria #ifdef __PSVITA__ -__int64 BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs +int64_t BiomeSource::findSeed(LevelType *generator, bool* pServerRunning) // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs #else -__int64 BiomeSource::findSeed(LevelType *generator) +int64_t BiomeSource::findSeed(LevelType *generator) #endif { - __int64 bestSeed = 0; + int64_t bestSeed = 0; ProgressRenderer *mcprogress = Minecraft::GetInstance()->progressRenderer; mcprogress->progressStage(IDS_PROGRESS_NEW_WORLD_SEED); @@ -452,7 +452,7 @@ __int64 BiomeSource::findSeed(LevelType *generator) // Just keeping trying to generate seeds until we find one that matches our criteria do { - __int64 seed = pr->nextLong(); + int64_t seed = pr->nextLong(); BiomeSource *biomeSource = new BiomeSource(seed,generator); biomeSource->getRawBiomeIndices(indices, biomeOffset, biomeOffset, biomeWidth, biomeWidth); @@ -484,7 +484,7 @@ __int64 BiomeSource::findSeed(LevelType *generator) unsigned int *pixels = new unsigned int[54 * 16 * 54 * 16]; for(int i = 0; i < 54 * 16 * 54 * 16; i++ ) - { + { int id = biomes[i]->id; // Create following colours: @@ -560,7 +560,7 @@ void BiomeSource::getFracs(intArray indices, float *fracs) bool BiomeSource::getIsMatch(float *frac) { // A true for a particular biome type here marks it as one that *has* to be present - static const bool critical[Biome::BIOME_COUNT] = { + static const bool critical[Biome::BIOME_COUNT] = { true, // ocean true, // plains true, // desert diff --git a/Minecraft.World/BiomeSource.h b/Minecraft.World/BiomeSource.h index bef09db0..a1e8a50b 100644 --- a/Minecraft.World/BiomeSource.h +++ b/Minecraft.World/BiomeSource.h @@ -25,20 +25,20 @@ private: protected: void _init(); - void _init(__int64 seed, LevelType *generator); + void _init(int64_t seed, LevelType *generator); BiomeSource(); public: - BiomeSource(__int64 seed, LevelType *generator); + BiomeSource(int64_t seed, LevelType *generator); BiomeSource(Level *level); private: static bool getIsMatch(float *frac); // 4J added static void getFracs(intArray indices, float *fracs); // 4J added public: #ifdef __PSVITA__ - static __int64 findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added + static int64_t findSeed(LevelType *generator, bool* pServerRunning); // MGH - added pRunning, so we can early out of this on Vita as it can take up to 60 secs // 4J added #else - static __int64 findSeed(LevelType *generator); // 4J added + static int64_t findSeed(LevelType *generator); // 4J added #endif ~BiomeSource(); @@ -71,7 +71,7 @@ public: /** * Checks if an area around a block contains only the specified biomes. * Useful for placing elements like towns. - * + * * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -80,7 +80,7 @@ public: /** * Checks if an area around a block contains only the specified biome. * Useful for placing elements like towns. - * + * * This is a bit of a rough check, to make it as fast as possible. To ensure * NO other biomes, add a margin of at least four blocks to the radius */ @@ -89,7 +89,7 @@ public: /** * Finds the specified biome within the radius. This will return a random * position if several are found. This test is fairly rough. - * + * * Returns null if the biome wasn't found */ virtual TilePos *findBiome(int x, int z, int r, Biome *toFind, Random *random); @@ -97,7 +97,7 @@ public: /** * Finds one of the specified biomes within the radius. This will return a * random position if several are found. This test is fairly rough. - * + * * Returns null if the biome wasn't found */ virtual TilePos *findBiome(int x, int z, int r, vector allowed, Random *random); diff --git a/Minecraft.World/ByteArrayInputStream.cpp b/Minecraft.World/ByteArrayInputStream.cpp index 394bda14..b0167300 100644 --- a/Minecraft.World/ByteArrayInputStream.cpp +++ b/Minecraft.World/ByteArrayInputStream.cpp @@ -51,7 +51,7 @@ int ByteArrayInputStream::read() // //The read(b) method for class InputStream has the same effect as: // -// read(b, 0, b.length) +// read(b, 0, b.length) //Parameters: //b - the buffer into which the data is read. //Returns: @@ -100,7 +100,7 @@ void ByteArrayInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 ByteArrayInputStream::skip(__int64 n) +int64_t ByteArrayInputStream::skip(int64_t n) { int newPos = pos + n; diff --git a/Minecraft.World/ByteArrayInputStream.h b/Minecraft.World/ByteArrayInputStream.h index e74b1cf7..5b2d95cf 100644 --- a/Minecraft.World/ByteArrayInputStream.h +++ b/Minecraft.World/ByteArrayInputStream.h @@ -19,7 +19,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); // 4J Stu Added - Sometimes we don't want to delete the data on destroying this void reset() { buf = byteArray(); count = 0; mark = 0; pos = 0; } diff --git a/Minecraft.World/ByteBuffer.cpp b/Minecraft.World/ByteBuffer.cpp index 66514737..57b30dbd 100644 --- a/Minecraft.World/ByteBuffer.cpp +++ b/Minecraft.World/ByteBuffer.cpp @@ -176,20 +176,20 @@ int ByteBuffer::getInt(unsigned int index) // //Returns: //The long value at the buffer's current position -__int64 ByteBuffer::getLong() +int64_t ByteBuffer::getLong() { assert( m_position+8 < m_limit ); - __int64 value = 0; + int64_t value = 0; - __int64 b1 = buffer[ m_position ]; - __int64 b2 = buffer[ m_position+1 ]; - __int64 b3 = buffer[ m_position+2 ]; - __int64 b4 = buffer[ m_position+3 ]; - __int64 b5 = buffer[ m_position+4 ]; - __int64 b6 = buffer[ m_position+5 ]; - __int64 b7 = buffer[ m_position+6 ]; - __int64 b8 = buffer[ m_position+7 ]; + int64_t b1 = buffer[ m_position ]; + int64_t b2 = buffer[ m_position+1 ]; + int64_t b3 = buffer[ m_position+2 ]; + int64_t b4 = buffer[ m_position+3 ]; + int64_t b5 = buffer[ m_position+4 ]; + int64_t b6 = buffer[ m_position+5 ]; + int64_t b7 = buffer[ m_position+6 ]; + int64_t b8 = buffer[ m_position+7 ]; m_position += 8; @@ -358,7 +358,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) // TODO 4J Stu - Should this function be writing from the start of the buffer, or from position? // And should it update position? assert( s.length*2 <= m_limit); - + // 4J Stu - Assumes big endian memcpy( buffer, s.data, s.length*2 ); @@ -373,7 +373,7 @@ ByteBuffer *ByteBuffer::putShortArray(shortArray &s) //value - The long value to be written //Returns: //This buffer -ByteBuffer *ByteBuffer::putLong(__int64 value) +ByteBuffer *ByteBuffer::putLong(int64_t value) { assert( m_position+7 < m_limit ); @@ -407,7 +407,7 @@ ByteBuffer *ByteBuffer::putLong(__int64 value) //This method transfers the entire content of the given source byte array into this buffer. //An invocation of this method of the form dst.put(a) behaves in exactly the same way as the invocation // -// dst.put(a, 0, a.length) +// dst.put(a, 0, a.length) //Returns: //This buffer ByteBuffer *ByteBuffer::put(byteArray inputArray) @@ -436,7 +436,7 @@ byteArray ByteBuffer::array() //it will be read-only if, and only if, this buffer is read-only. // //Returns: -//A new int buffer +//A new int buffer IntBuffer *ByteBuffer::asIntBuffer() { // TODO 4J Stu - Is it safe to just cast our byte array pointer to another type? @@ -463,7 +463,7 @@ FloatBuffer *ByteBuffer::asFloatBuffer() #ifdef __PS3__ // we're using the RSX now to upload textures to vram, so we need th main ram textures allocated from io space -ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity ) +ByteBuffer_IO::ByteBuffer_IO( unsigned int capacity ) : ByteBuffer(capacity, (byte*)RenderManager.allocIOMem(capacity, 64)) { memset( buffer,0,sizeof(byte)*capacity); diff --git a/Minecraft.World/ByteBuffer.h b/Minecraft.World/ByteBuffer.h index 2d936374..56ac0b96 100644 --- a/Minecraft.World/ByteBuffer.h +++ b/Minecraft.World/ByteBuffer.h @@ -28,7 +28,7 @@ public: int getInt(unsigned int index); void get(byteArray) {} // 4J - TODO byte get(int index); - __int64 getLong(); + int64_t getLong(); short getShort(); void getShortArray(shortArray &s); ByteBuffer *put(int index, byte b); @@ -36,7 +36,7 @@ public: ByteBuffer *putInt(unsigned int index, int value); ByteBuffer *putShort(short value); ByteBuffer *putShortArray(shortArray &s); - ByteBuffer *putLong(__int64 value); + ByteBuffer *putLong(int64_t value); ByteBuffer *put(byteArray inputArray); byteArray array(); IntBuffer *asIntBuffer(); diff --git a/Minecraft.World/C4JThread.h b/Minecraft.World/C4JThread.h index 9a303c7b..346f123d 100644 --- a/Minecraft.World/C4JThread.h +++ b/Minecraft.World/C4JThread.h @@ -66,7 +66,7 @@ public: e_modeAutoClear, e_modeManualClear }; - Event(EMode mode = e_modeAutoClear); + Event(EMode mode = e_modeAutoClear); ~Event(); void Set(); void Clear(); @@ -75,7 +75,7 @@ public: private: EMode m_mode; #ifdef __PS3__ - sys_event_flag_t m_event; + sys_event_flag_t m_event; #elif defined __ORBIS__ SceKernelEventFlag m_event; #elif defined __PSVITA__ @@ -111,7 +111,7 @@ public: int m_size; EMode m_mode; #ifdef __PS3__ - sys_event_flag_t m_events; + sys_event_flag_t m_events; #elif defined __ORBIS__ SceKernelEventFlag m_events; #elif defined __PSVITA__ @@ -129,7 +129,7 @@ public: typedef void (ThreadInitFunc)(); C4JThread* m_thread; - std::queue m_queue; + std::queue m_queue; C4JThread::EventArray* m_startEvent; C4JThread::Event* m_finishedEvent; CRITICAL_SECTION m_critSect; @@ -187,7 +187,7 @@ private: bool m_isRunning; bool m_hasStarted; int m_exitCode; - __int64 m_lastSleepTime; + int64_t m_lastSleepTime; static std::vector ms_threadList; static CRITICAL_SECTION ms_threadListCS; diff --git a/Minecraft.World/CanyonFeature.cpp b/Minecraft.World/CanyonFeature.cpp index b96c97e0..4eea3902 100644 --- a/Minecraft.World/CanyonFeature.cpp +++ b/Minecraft.World/CanyonFeature.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.tile.h" #include "net.minecraft.world.level.biome.h" -void CanyonFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void CanyonFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { MemSect(49); Random *random = new Random(seed); diff --git a/Minecraft.World/CanyonFeature.h b/Minecraft.World/CanyonFeature.h index cf3f7a61..d3edbf1f 100644 --- a/Minecraft.World/CanyonFeature.h +++ b/Minecraft.World/CanyonFeature.h @@ -9,6 +9,6 @@ private: float rs[1024]; protected: - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/Minecraft.World/CaveFeature.cpp b/Minecraft.World/CaveFeature.cpp index aad92805..95e5a5be 100644 --- a/Minecraft.World/CaveFeature.cpp +++ b/Minecraft.World/CaveFeature.cpp @@ -20,7 +20,7 @@ using namespace std; double radius = random->nextDouble() * 4 + 2; double fuss = random->nextDouble() * 0.6; - __int64 seed = random->nextLong(); + int64_t seed = random->nextLong(); random->setSeed(seed); vector toRemove; @@ -69,14 +69,14 @@ using namespace std; } } } - + AUTO_VAR(itEnd, toRemove.end()); for (AUTO_VAR(it, toRemove.begin()); it != itEnd; it++) { TilePos *p = *it; //toRemove[i]; level->setTileNoUpdate(p->x, p->y, p->z, 0); } - + itEnd = toRemove.end(); for (AUTO_VAR(it, toRemove.begin()); it != itEnd; it++) { diff --git a/Minecraft.World/ChunkPos.cpp b/Minecraft.World/ChunkPos.cpp index 3f9674a7..1bdf165d 100644 --- a/Minecraft.World/ChunkPos.cpp +++ b/Minecraft.World/ChunkPos.cpp @@ -6,16 +6,16 @@ ChunkPos::ChunkPos(int x, int z) : x( x ), z( z ) { } -__int64 ChunkPos::hashCode(int x, int z) +int64_t ChunkPos::hashCode(int x, int z) { - __int64 xx = x; - __int64 zz = z; + int64_t xx = x; + int64_t zz = z; return (xx & 0xffffffffl) | ((zz & 0xffffffffl) << 32l); } int ChunkPos::hashCode() { - __int64 hash = hashCode(x, z); + int64_t hash = hashCode(x, z); int h1 = (int) (hash); int h2 = (int) (hash >> 32l); return h1 ^ h2; @@ -53,7 +53,7 @@ int ChunkPos::getMiddleBlockZ() return ( z << 4 ) + 8; } -TilePos ChunkPos::getMiddleBlockPosition(int y) +TilePos ChunkPos::getMiddleBlockPosition(int y) { return TilePos(getMiddleBlockX(), y, getMiddleBlockZ()); } @@ -63,7 +63,7 @@ wstring ChunkPos::toString() return L"[" + _toString(x) + L", " + _toString(z) + L"]"; } -__int64 ChunkPos::hash_fnct(const ChunkPos &k) +int64_t ChunkPos::hash_fnct(const ChunkPos &k) { return k.hashCode(k.x,k.z); } diff --git a/Minecraft.World/ChunkPos.h b/Minecraft.World/ChunkPos.h index 2a3fda02..55bd1ebb 100644 --- a/Minecraft.World/ChunkPos.h +++ b/Minecraft.World/ChunkPos.h @@ -10,7 +10,7 @@ public: ChunkPos(int x, int z); - static __int64 hashCode(int x, int z); + static int64_t hashCode(int x, int z); int hashCode(); double distanceToSqr(shared_ptr e); @@ -22,7 +22,7 @@ public: TilePos getMiddleBlockPosition(int y); wstring toString(); - static __int64 hash_fnct(const ChunkPos &k); + static int64_t hash_fnct(const ChunkPos &k); static bool eq_test(const ChunkPos &x, const ChunkPos &y); bool operator == (const ChunkPos &k) const { return (this->x == k.x) && ( this->z == k.z); } ChunkPos & operator= (const ChunkPos & other) { x = other.x; z = other.z; return *this; } @@ -30,12 +30,12 @@ public: struct ChunkPosKeyHash { - inline __int64 operator()(const ChunkPos &k) const + inline int64_t operator()(const ChunkPos &k) const { return ChunkPos::hash_fnct(k); } }; struct ChunkPosKeyEq { - inline bool operator()(const ChunkPos &x, const ChunkPos &y) const + inline bool operator()(const ChunkPos &x, const ChunkPos &y) const { return ChunkPos::eq_test(x, y); } }; \ No newline at end of file diff --git a/Minecraft.World/ChunkStorageProfileDecorator.cpp b/Minecraft.World/ChunkStorageProfileDecorator.cpp index 76ffddbc..5d757811 100644 --- a/Minecraft.World/ChunkStorageProfileDecorator.cpp +++ b/Minecraft.World/ChunkStorageProfileDecorator.cpp @@ -10,7 +10,7 @@ ChunkStorageProfilerDecorator::ChunkStorageProfilerDecorator(ChunkStorage *capsu LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); LevelChunk *chunk = capsulated->load(level, x, z); timeSpentLoading += System::nanoTime() - nanoTime; loadCount++; @@ -20,7 +20,7 @@ LevelChunk *ChunkStorageProfilerDecorator::load(Level *level, int x, int z) void ChunkStorageProfilerDecorator::save(Level *level, LevelChunk *levelChunk) { - __int64 nanoTime = System::nanoTime(); + int64_t nanoTime = System::nanoTime(); capsulated->save(level, levelChunk); timeSpentSaving += System::nanoTime() - nanoTime; saveCount++; @@ -59,7 +59,7 @@ void ChunkStorageProfilerDecorator::tick() sprintf(buf,"Average save time: %f (%I64d)",0.000001 * (double) timeSpentSaving / (double) loadCount, loadCount); #endif app.DebugPrintf(buf); -#endif +#endif } counter = 0; } diff --git a/Minecraft.World/ChunkStorageProfileDecorator.h b/Minecraft.World/ChunkStorageProfileDecorator.h index 67c582da..02ea4dcb 100644 --- a/Minecraft.World/ChunkStorageProfileDecorator.h +++ b/Minecraft.World/ChunkStorageProfileDecorator.h @@ -8,10 +8,10 @@ class ChunkStorageProfilerDecorator : public ChunkStorage private: ChunkStorage *capsulated; - __int64 timeSpentLoading; - __int64 loadCount; - __int64 timeSpentSaving; - __int64 saveCount; + int64_t timeSpentLoading; + int64_t loadCount; + int64_t timeSpentSaving; + int64_t saveCount; int counter; diff --git a/Minecraft.World/CompoundTag.h b/Minecraft.World/CompoundTag.h index 32c31583..aa16f8a1 100644 --- a/Minecraft.World/CompoundTag.h +++ b/Minecraft.World/CompoundTag.h @@ -11,7 +11,7 @@ #include "ByteArrayTag.h" #include "IntArrayTag.h" -class CompoundTag : public Tag +class CompoundTag : public Tag { private: unordered_map tags; @@ -46,7 +46,7 @@ public: { // 4J - was return tags.values(); vector *ret = new vector; - + AUTO_VAR(itEnd, tags.end()); for( unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) { @@ -80,7 +80,7 @@ public: tags[name] = (new IntTag(name,value)); } - void putLong(wchar_t * name, __int64 value) + void putLong(wchar_t * name, int64_t value) { tags[name] = (new LongTag(name,value)); } @@ -126,7 +126,7 @@ public: if(it != tags.end()) return it->second; return NULL; } - + bool contains(wchar_t * name) { return tags.find(name) != tags.end(); @@ -150,9 +150,9 @@ public: return ((IntTag *) tags[name])->data; } - __int64 getLong(wchar_t * name) + int64_t getLong(wchar_t * name) { - if (tags.find(name) == tags.end()) return (__int64)0; + if (tags.find(name) == tags.end()) return (int64_t)0; return ((LongTag *) tags[name])->data; } @@ -227,7 +227,7 @@ public: char *newPrefix = new char[ strlen(prefix) + 4 ]; strcpy( newPrefix, prefix); strcat( newPrefix, " "); - + AUTO_VAR(itEnd, tags.end()); for( unordered_map::iterator it = tags.begin(); it != itEnd; it++ ) { @@ -255,10 +255,10 @@ public: Tag *copy() { CompoundTag *tag = new CompoundTag(getName()); - + AUTO_VAR(itEnd, tags.end()); for( AUTO_VAR(it, tags.begin()); it != itEnd; it++ ) - { + { tag->put((wchar_t *)it->first.c_str(), it->second->copy()); } return tag; diff --git a/Minecraft.World/CompressedTileStorage.cpp b/Minecraft.World/CompressedTileStorage.cpp index 896bd58d..78b37ad8 100644 --- a/Minecraft.World/CompressedTileStorage.cpp +++ b/Minecraft.World/CompressedTileStorage.cpp @@ -142,7 +142,7 @@ CompressedTileStorage::CompressedTileStorage(bool isEmpty) #endif } -bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) +bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 (representing a 16 byte range) { int block; unsigned short *blockIndices = (unsigned short *)indicesAndData; @@ -151,7 +151,7 @@ bool CompressedTileStorage::isRenderChunkEmpty(int y) // y == 0, 16, 32... 112 ( for( int z = 0; z < 16; z += 4 ) { getBlock(&block, x, y, z); - __uint64 *comp = (__uint64 *)&blockIndices[block]; + uint64_t *comp = (uint64_t *)&blockIndices[block]; // Are the 4 y regions stored here all zero? (INDEX_TYPE_0_OR_8_BIT | INDEX_TYPE_0_BIT_FLAG ) if( ( *comp ) != 0x0007000700070007L ) return false; } @@ -169,18 +169,18 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) // Attempt to compare as much as we can in 64-byte chunks (8 groups of 8 bytes) int quickCount = allocatedSize / 64; - __int64 *pOld = (__int64 *)indicesAndData; - __int64 *pNew = (__int64 *)other->indicesAndData; + int64_t *pOld = (int64_t *)indicesAndData; + int64_t *pNew = (int64_t *)other->indicesAndData; for( int i = 0; i < quickCount; i++ ) { - __int64 d0 = pOld[0] ^ pNew[0]; - __int64 d1 = pOld[1] ^ pNew[1]; - __int64 d2 = pOld[2] ^ pNew[2]; - __int64 d3 = pOld[3] ^ pNew[3]; - __int64 d4 = pOld[4] ^ pNew[4]; - __int64 d5 = pOld[5] ^ pNew[5]; - __int64 d6 = pOld[6] ^ pNew[6]; - __int64 d7 = pOld[7] ^ pNew[7]; + int64_t d0 = pOld[0] ^ pNew[0]; + int64_t d1 = pOld[1] ^ pNew[1]; + int64_t d2 = pOld[2] ^ pNew[2]; + int64_t d3 = pOld[3] ^ pNew[3]; + int64_t d4 = pOld[4] ^ pNew[4]; + int64_t d5 = pOld[5] ^ pNew[5]; + int64_t d6 = pOld[6] ^ pNew[6]; + int64_t d7 = pOld[7] ^ pNew[7]; d0 |= d1; d2 |= d3; d4 |= d5; @@ -194,7 +194,7 @@ bool CompressedTileStorage::isSameAs(CompressedTileStorage *other) } pOld += 8; pNew += 8; - } + } // Now test anything remaining just byte at a time unsigned char *pucOld = (unsigned char *)pOld; @@ -261,7 +261,7 @@ inline int CompressedTileStorage::getIndex(int block, int tile) // and z is: ___________zzzz // and maps to this bit of b ________bb_____ // and this bit of t ___________tt__ -// +// inline void CompressedTileStorage::getBlockAndTile(int *block, int *tile, int x, int y, int z) { @@ -302,7 +302,7 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) int offsets[512]; int memToAlloc = 0; // static int type0 = 0, type1 = 0, type2 = 0, type4 = 0, type8 = 0, chunkTotal = 0; - + // Loop round all blocks for( int i = 0; i < 512; i++ ) { @@ -332,8 +332,8 @@ void CompressedTileStorage::setData(byteArray dataIn, unsigned int inOffset) } } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4 x 4 tiles in the block { int tile = data[getIndex(i,j)]; @@ -889,7 +889,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) unsigned char *unpacked_data = NULL; unsigned char *packed_data; - // First task is to find out what type of storage each block needs. Need to unpack each where required. + // First task is to find out what type of storage each block needs. Need to unpack each where required. // Note that we don't need to fully unpack the data at this stage since we are only interested in working out how many unique types of tiles are in each block, not // what those actual tile ids are. if( upgradeBlock == -1 ) @@ -950,8 +950,8 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } #else - __uint64 usedFlags[4] = {0,0,0,0}; - __int64 i64_1 = 1; // MGH - instead of 1i64, which is MS specific + uint64_t usedFlags[4] = {0,0,0,0}; + int64_t i64_1 = 1; // MGH - instead of 1i64, which is MS specific for( int j = 0; j < 64; j++ ) // This loop of 64 is to go round the 4x4x4 tiles in the block { int tiletype = unpacked_data[j]; @@ -1025,7 +1025,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) } } switch(_blockIndices[i]) - { + { case INDEX_TYPE_1_BIT: memToAlloc += 10; break; @@ -1096,7 +1096,7 @@ void CompressedTileStorage::compress(int upgradeBlock/*=-1*/) else { packed_data = data + ( ( blockIndices[i] >> INDEX_OFFSET_SHIFT ) & INDEX_OFFSET_MASK); - + int dataSize = 8 << indexTypeOld; // 8, 16 or 32 bytes of per-tile storage dataSize += 1 << ( 1 << indexTypeOld ); // 2, 4 or 16 bytes to store each tile type newIndices[i] |= ( usDataOffset & INDEX_OFFSET_MASK) << INDEX_OFFSET_SHIFT; @@ -1289,7 +1289,7 @@ int CompressedTileStorage::getHighestNonEmptyY() if(found) break; } - + int highestNonEmptyY = -1; if(found) { diff --git a/Minecraft.World/ConsoleSaveFileInputStream.h b/Minecraft.World/ConsoleSaveFileInputStream.h index 876a9484..7f4a69c4 100644 --- a/Minecraft.World/ConsoleSaveFileInputStream.h +++ b/Minecraft.World/ConsoleSaveFileInputStream.h @@ -17,7 +17,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } + virtual int64_t skip(int64_t n) { return n; } private: ConsoleSaveFile *m_saveFile; diff --git a/Minecraft.World/ConsoleSaveFileOriginal.cpp b/Minecraft.World/ConsoleSaveFileOriginal.cpp index 139d99ac..58765a4c 100644 --- a/Minecraft.World/ConsoleSaveFileOriginal.cpp +++ b/Minecraft.World/ConsoleSaveFileOriginal.cpp @@ -35,7 +35,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID // We'll only be committing these as required to grow the storage we need, which will // the storage to grow without having to use realloc. - // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp. + // AP - The Vita doesn't have virtual memory so a pretend system has been implemented in PSVitaStubs.cpp. // All access to the memory must be done via the access function as the pointer returned from VirtualAlloc // can't be used directly. pvHeap = VirtualAlloc(NULL, MAX_PAGE_COUNT * CSF_PAGE_SIZE, RESERVE_ALLOCATION, PAGE_READWRITE ); @@ -116,7 +116,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID #endif app.DebugPrintf("Filesize - %d, Adjusted size - %d\n",fileSize,storageLength); fileSize = storageLength; - } + } #ifdef __PSVITA__ if(plat == SAVE_FILE_PLATFORM_PSVITA) @@ -202,7 +202,7 @@ ConsoleSaveFileOriginal::ConsoleSaveFileOriginal(const wstring &fileName, LPVOID } else - { + { // Clear the first 8 bytes that reference the header header.WriteHeader( pvSaveMem ); } @@ -213,7 +213,7 @@ ConsoleSaveFileOriginal::~ConsoleSaveFileOriginal() VirtualFree( pvHeap, MAX_PAGE_COUNT * CSF_PAGE_SIZE, MEM_DECOMMIT ); pagesCommitted = 0; // Make sure we don't have any thumbnail data still waiting round - we can't need it now we've destroyed the save file anyway -#if defined _XBOX +#if defined _XBOX app.GetSaveThumbnail(NULL,NULL); #elif defined __PS3__ app.GetSaveThumbnail(NULL,NULL, NULL,NULL); @@ -548,7 +548,7 @@ void ConsoleSaveFileOriginal::MoveDataBeyond(FileEntry *file, DWORD nNumberOfByt if ( uiCopyEnd > uiFromEnd ) { // Needs to be clamped to the end of our region - uiCopyEnd = uiFromEnd; + uiCopyEnd = uiFromEnd; } #ifdef __PSVITA__ // AP - use this to access the virtual memory @@ -749,7 +749,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) BYTE bTextMetadata[88]; ZeroMemory(bTextMetadata,88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL) { @@ -765,7 +765,7 @@ void ConsoleSaveFileOriginal::Flush(bool autosave, bool updateThumbnail ) #ifdef _XBOX StorageManager.SaveSaveData( compLength+8,pbThumbnailData,dwThumbnailDataSize,bTextMetadata,iTextMetadataBytes ); - delete [] pbThumbnailData; + delete [] pbThumbnailData; #ifndef _CONTENT_PACKAGE if( app.DebugSettingsOn()) { diff --git a/Minecraft.World/ConsoleSaveFileSplit.cpp b/Minecraft.World/ConsoleSaveFileSplit.cpp index 2d83f217..9fe7f8c7 100644 --- a/Minecraft.World/ConsoleSaveFileSplit.cpp +++ b/Minecraft.World/ConsoleSaveFileSplit.cpp @@ -41,7 +41,7 @@ ConsoleSaveFileSplit::RegionFileReference::~RegionFileReference() // Compress from data to dataCompressed. Uses a special compression method that is designed just to efficiently store runs of zeros, with little overhead on other stuff. // Compresed format is a 4 byte uncompressed size, followed by data as follows: -// +// // Byte value Meaning // // 1 - 255 Normal data @@ -375,7 +375,7 @@ FileEntry *ConsoleSaveFileSplit::GetRegionFileEntry(unsigned int regionIndex) int index = StorageManager.AddSubfile(regionIndex); RegionFileReference *newRef = new RegionFileReference(index, regionIndex); regionFiles[regionIndex] = newRef; - + return newRef->fileEntry; } @@ -513,7 +513,7 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO StorageManager.GetSaveData( pvSaveMem, &storageLength ); app.DebugPrintf("Filesize - %d, Adjusted size - %d\n",fileSize,storageLength); fileSize = storageLength; - } + } int compressed = *(int*)pvSaveMem; if( compressed == 0 ) @@ -532,7 +532,7 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO else { unsigned char *buf = new unsigned char[decompSize]; - + if( Compression::getCompression()->Decompress(buf, &decompSize, (unsigned char *)pvSaveMem+8, fileSize-8 ) == S_OK) { @@ -575,7 +575,7 @@ void ConsoleSaveFileSplit::_init(const wstring &fileName, LPVOID pvSaveData, DWO } else - { + { // Clear the first 8 bytes that reference the header header.WriteHeader( pvSaveMem ); } @@ -586,7 +586,7 @@ ConsoleSaveFileSplit::~ConsoleSaveFileSplit() VirtualFree( pvHeap, MAX_PAGE_COUNT * CSF_PAGE_SIZE, MEM_DECOMMIT ); pagesCommitted = 0; // Make sure we don't have any thumbnail data still waiting round - we can't need it now we've destroyed the save file anyway -#if defined _XBOX +#if defined _XBOX app.GetSaveThumbnail(NULL,NULL); #elif defined __PS3__ app.GetSaveThumbnail(NULL,NULL, NULL,NULL); @@ -606,7 +606,7 @@ ConsoleSaveFileSplit::~ConsoleSaveFileSplit() FileEntry *ConsoleSaveFileSplit::createFile( const ConsoleSavePath &fileName ) { LockSaveAccess(); - + // Determine if the file is a region file that should be split off into its own file unsigned int regionFileIndex; bool isRegionFile = GetNumericIdentifierFromName(fileName.getName(), ®ionFileIndex); @@ -942,7 +942,7 @@ void ConsoleSaveFileSplit::tick() } } - // Compile a vector of dirty regions. + // Compile a vector of dirty regions. vector dirtyRegions; for( AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++ ) { @@ -999,7 +999,7 @@ void ConsoleSaveFileSplit::tick() { unsigned int totalDirty = 0; unsigned int totalDirtyBytes = 0; - __int64 oldestDirty = currentTime; + int64_t oldestDirty = currentTime; for( AUTO_VAR(it, regionFiles.begin()); it != regionFiles.end(); it++ ) { if( it->second->dirty ) @@ -1051,7 +1051,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT // Only ReAlloc if we need to (we might already have enough) and align to 512 byte boundaries DWORD currentHeapSize = pagesCommitted * CSF_PAGE_SIZE; - + DWORD desiredSize = header.GetFileSize() + nNumberOfBytesToWrite; if( desiredSize > currentHeapSize ) @@ -1117,7 +1117,7 @@ void ConsoleSaveFileSplit::MoveDataBeyond(FileEntry *file, DWORD nNumberOfBytesT if ( uiCopyEnd > uiFromEnd ) { // Needs to be clamped to the end of our region - uiCopyEnd = uiFromEnd; + uiCopyEnd = uiFromEnd; } XMemCpy( (void *)(uiCopyStart + nNumberOfBytesToWrite), ( void *)uiCopyStart, uiCopyEnd - uiCopyStart ); } @@ -1381,7 +1381,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) // Attempt to allocate the required memory compData = (byte *)StorageManager.AllocateSaveData( compLength ); } - + if(compData != NULL) { // Re-compress all save data before we save it to disk @@ -1421,7 +1421,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) BYTE bTextMetadata[88]; ZeroMemory(bTextMetadata,88); - __int64 seed = 0; + int64_t seed = 0; bool hasSeed = false; if(MinecraftServer::getInstance()!= NULL && MinecraftServer::getInstance()->levels[0]!=NULL) { @@ -1436,7 +1436,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) app.DebugPrintf("Save thumbnail size %d\n",dwThumbnailDataSize); } - + INT saveOrCheckpointId = 0; bool validSave = StorageManager.GetSaveUniqueNumber(&saveOrCheckpointId); TelemetryManager->RecordLevelSaveOrCheckpoint(ProfileManager.GetPrimaryPad(), saveOrCheckpointId, compLength+8); @@ -1459,7 +1459,7 @@ void ConsoleSaveFileSplit::Flush(bool autosave, bool updateThumbnail) int ConsoleSaveFileSplit::SaveSaveDataCallback(LPVOID lpParam,bool bRes) { ConsoleSaveFileSplit *pClass=(ConsoleSaveFileSplit *)lpParam; - + // Don't save sub files on autosave (their always being saved anyway) if (!pClass->m_autosave) { @@ -1472,7 +1472,7 @@ int ConsoleSaveFileSplit::SaveSaveDataCallback(LPVOID lpParam,bool bRes) int ConsoleSaveFileSplit::SaveRegionFilesCallback(LPVOID lpParam,bool bRes) { ConsoleSaveFileSplit *pClass=(ConsoleSaveFileSplit *)lpParam; - + // This is called from the StorageManager.Tick() which should always be on the main thread pClass->processSubfilesAfterWrite(); diff --git a/Minecraft.World/CustomLevelSource.cpp b/Minecraft.World/CustomLevelSource.cpp index 216e63b9..0d8ad81c 100644 --- a/Minecraft.World/CustomLevelSource.cpp +++ b/Minecraft.World/CustomLevelSource.cpp @@ -12,7 +12,7 @@ const double CustomLevelSource::SNOW_SCALE = 0.3; const double CustomLevelSource::SNOW_CUTOFF = 0.5; -CustomLevelSource::CustomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +CustomLevelSource::CustomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { #ifdef _OVERRIDE_HEIGHTMAP m_XZSize = level->getLevelData()->getXZSize(); @@ -326,7 +326,7 @@ void CustomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi run = runDepth; if (y >= waterHeight - 1) blocks[offs] = top; else blocks[offs] = material; - } + } else if (run > 0) { run--; @@ -399,7 +399,7 @@ LevelChunk *CustomLevelSource::getChunk(int xOffs, int zOffs) // addCaves(xOffs, zOffs, blocks); // addTowns(xOffs, zOffs, blocks); - // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method + // levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method // 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also // now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore. @@ -504,8 +504,8 @@ void CustomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; diff --git a/Minecraft.World/CustomLevelSource.h b/Minecraft.World/CustomLevelSource.h index af01a478..35b22554 100644 --- a/Minecraft.World/CustomLevelSource.h +++ b/Minecraft.World/CustomLevelSource.h @@ -44,7 +44,7 @@ private: const bool generateStructures; public: - CustomLevelSource(Level *level, __int64 seed, bool generateStructures); + CustomLevelSource(Level *level, int64_t seed, bool generateStructures); ~CustomLevelSource(); public: @@ -75,5 +75,5 @@ public: public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/DataInput.h b/Minecraft.World/DataInput.h index 258b2717..f61eceb5 100644 --- a/Minecraft.World/DataInput.h +++ b/Minecraft.World/DataInput.h @@ -13,7 +13,7 @@ public: virtual double readDouble() = 0; virtual float readFloat() = 0; virtual int readInt() = 0; - virtual __int64 readLong() = 0; + virtual int64_t readLong() = 0; virtual short readShort() = 0; virtual wchar_t readChar() = 0; virtual wstring readUTF() = 0; diff --git a/Minecraft.World/DataInputStream.cpp b/Minecraft.World/DataInputStream.cpp index 2291bf48..3bdd5349 100644 --- a/Minecraft.World/DataInputStream.cpp +++ b/Minecraft.World/DataInputStream.cpp @@ -32,8 +32,8 @@ int DataInputStream::read() // //The read(b) method has the same effect as: // -// read(b, 0, b.length) -// +// read(b, 0, b.length) +// //Overrides: //read in class FilterInputStream //Parameters: @@ -102,7 +102,7 @@ unsigned char DataInputStream::readUnsignedByte() //Reads two input bytes and returns a char value. Let a be the first byte read and b be the second byte. The value returned is: //(char)((a << 8) | (b & 0xff)) -// +// //This method is suitable for reading bytes written by the writeChar method of interface DataOutput. //Returns: //the char value read. @@ -110,7 +110,7 @@ wchar_t DataInputStream::readChar() { int a = stream->read(); int b = stream->read(); - return (wchar_t)((a << 8) | (b & 0xff)); + return (wchar_t)((a << 8) | (b & 0xff)); } //Reads some bytes from an input stream and stores them into the buffer array b. The number of bytes read is equal to the length of b. @@ -170,7 +170,7 @@ bool DataInputStream::readFully(charArray b) //the double value read. double DataInputStream::readDouble() { - __int64 bits = readLong(); + int64_t bits = readLong(); return Double::longBitsToDouble( bits ); } @@ -188,10 +188,10 @@ float DataInputStream::readFloat() } //Reads four input bytes and returns an int value. Let a-d be the first through fourth bytes read. The value returned is: -// +// // (((a & 0xff) << 24) | ((b & 0xff) << 16) | // ((c & 0xff) << 8) | (d & 0xff)) -// +// //This method is suitable for reading bytes written by the writeInt method of interface DataOutput. //Returns: //the int value read. @@ -207,7 +207,7 @@ int DataInputStream::readInt() } //Reads eight input bytes and returns a long value. Let a-h be the first through eighth bytes read. The value returned is: -// +// // (((long)(a & 0xff) << 56) | // ((long)(b & 0xff) << 48) | // ((long)(c & 0xff) << 40) | @@ -216,23 +216,23 @@ int DataInputStream::readInt() // ((long)(f & 0xff) << 16) | // ((long)(g & 0xff) << 8) | // ((long)(h & 0xff))) -// +// //This method is suitable for reading bytes written by the writeLong method of interface DataOutput. // //Returns: //the long value read. -__int64 DataInputStream::readLong() +int64_t DataInputStream::readLong() { - __int64 a = stream->read(); - __int64 b = stream->read(); - __int64 c = stream->read(); - __int64 d = stream->read(); - __int64 e = stream->read(); - __int64 f = stream->read(); - __int64 g = stream->read(); - __int64 h = stream->read(); + int64_t a = stream->read(); + int64_t b = stream->read(); + int64_t c = stream->read(); + int64_t d = stream->read(); + int64_t e = stream->read(); + int64_t f = stream->read(); + int64_t g = stream->read(); + int64_t h = stream->read(); - __int64 bits = (((a & 0xff) << 56) | + int64_t bits = (((a & 0xff) << 56) | ((b & 0xff) << 48) | ((c & 0xff) << 40) | ((d & 0xff) << 32) | @@ -246,7 +246,7 @@ __int64 DataInputStream::readLong() //Reads two input bytes and returns a short value. Let a be the first byte read and b be the second byte. The value returned is: //(short)((a << 8) | (b & 0xff)) -// +// //This method is suitable for reading the bytes written by the writeShort method of interface DataOutput. //Returns: //the 16-bit value read. @@ -272,13 +272,13 @@ short DataInputStream::readShort() //then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // //(char)(((a& 0x1F) << 6) | (b & 0x3F)) -// +// //If the first byte of a group matches the bit pattern 1110xxxx, then the group consists of that byte a and two more bytes b and c. //If there is no byte c (because byte a was one of the last two of the bytes to be read), or either byte b or byte c does not match the bit //pattern 10xxxxxx, then a UTFDataFormatException is thrown. Otherwise, the group is converted to the character: // // (char)(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)) -// +// //If the first byte of a group matches the pattern 1111xxxx or the pattern 10xxxxxx, then a UTFDataFormatException is thrown. //If end of file is encountered at any time during this entire process, then an EOFException is thrown. // @@ -305,7 +305,7 @@ wstring DataInputStream::readUTF() outputString.push_back(theChar); }*/ - + unsigned short currentByteIndex = 0; while( currentByteIndex < UTFLength ) { @@ -390,7 +390,7 @@ wstring DataInputStream::readUTF() { // TODO 4J Stu - EOFException break; - } + } // No more bytes to read if( !(currentByteIndex < UTFLength) ) @@ -420,7 +420,7 @@ wstring DataInputStream::readUTF() continue; } } - + return outputString; } @@ -486,7 +486,7 @@ int DataInputStream::readUTFChar() { // TODO 4J Stu - EOFException return returnValue; - } + } int thirdByte = stream->read(); @@ -535,7 +535,7 @@ void DataInputStream::deleteChildStream() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 DataInputStream::skip(__int64 n) +int64_t DataInputStream::skip(int64_t n) { return stream->skip(n); } diff --git a/Minecraft.World/DataInputStream.h b/Minecraft.World/DataInputStream.h index f69d490a..043ab745 100644 --- a/Minecraft.World/DataInputStream.h +++ b/Minecraft.World/DataInputStream.h @@ -24,12 +24,12 @@ public: virtual double readDouble(); virtual float readFloat(); virtual int readInt(); - virtual __int64 readLong(); + virtual int64_t readLong(); virtual short readShort(); virtual wstring readUTF(); void deleteChildStream(); virtual int readUTFChar(); virtual PlayerUID readPlayerUID(); // 4J Added - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); virtual int skipBytes(int n); }; \ No newline at end of file diff --git a/Minecraft.World/DataOutput.h b/Minecraft.World/DataOutput.h index 648be6df..7ebf96da 100644 --- a/Minecraft.World/DataOutput.h +++ b/Minecraft.World/DataOutput.h @@ -10,7 +10,7 @@ public: virtual void writeDouble(double a) = 0; virtual void writeFloat(float a) = 0; virtual void writeInt(int a) = 0; - virtual void writeLong(__int64 a) = 0; + virtual void writeLong(int64_t a) = 0; virtual void writeShort(short a) = 0; virtual void writeBoolean(bool v) = 0; virtual void writeChar(wchar_t v) = 0; diff --git a/Minecraft.World/DataOutputStream.cpp b/Minecraft.World/DataOutputStream.cpp index 8e277c23..ede943d2 100644 --- a/Minecraft.World/DataOutputStream.cpp +++ b/Minecraft.World/DataOutputStream.cpp @@ -78,7 +78,7 @@ void DataOutputStream::writeByte(byte a) //v - a double value to be written. void DataOutputStream::writeDouble(double a) { - __int64 bits = Double::doubleToLongBits( a ); + int64_t bits = Double::doubleToLongBits( a ); writeLong( bits ); // TODO 4J Stu - Error handling? @@ -116,7 +116,7 @@ void DataOutputStream::writeInt(int a) //In no exception is thrown, the counter written is incremented by 8. //Parameters: //v - a long to be written. -void DataOutputStream::writeLong(__int64 a) +void DataOutputStream::writeLong(int64_t a) { stream->write( (a >> 56) & 0xff ); stream->write( (a >> 48) & 0xff ); @@ -178,7 +178,7 @@ void DataOutputStream::writeBoolean(bool b) { stream->write( b ? (byte)1 : (byte)0 ); // TODO 4J Stu - Error handling? - written += 1; + written += 1; } //Writes a string to the underlying output stream using modified UTF-8 encoding in a machine-independent manner. @@ -220,7 +220,7 @@ void DataOutputStream::writeUTF(const wstring& str) byteArray bytearr(utflen+2); bytearr[count++] = (byte) ((utflen >> 8) & 0xFF); - bytearr[count++] = (byte) ((utflen >> 0) & 0xFF); + bytearr[count++] = (byte) ((utflen >> 0) & 0xFF); int i=0; for (i=0; i > *players) return wrapped->createTag(players); } -__int64 DerivedLevelData::getSeed() +int64_t DerivedLevelData::getSeed() { return wrapped->getSeed(); } @@ -43,12 +43,12 @@ int DerivedLevelData::getZSpawn() return wrapped->getZSpawn(); } -__int64 DerivedLevelData::getTime() +int64_t DerivedLevelData::getTime() { return wrapped->getTime(); } -__int64 DerivedLevelData::getSizeOnDisk() +int64_t DerivedLevelData::getSizeOnDisk() { return wrapped->getSizeOnDisk(); } @@ -68,7 +68,7 @@ int DerivedLevelData::getVersion() return wrapped->getVersion(); } -__int64 DerivedLevelData::getLastPlayed() +int64_t DerivedLevelData::getLastPlayed() { return wrapped->getLastPlayed(); } @@ -98,7 +98,7 @@ GameType *DerivedLevelData::getGameType() return wrapped->getGameType(); } -void DerivedLevelData::setSeed(__int64 seed) +void DerivedLevelData::setSeed(int64_t seed) { } @@ -114,11 +114,11 @@ void DerivedLevelData::setZSpawn(int zSpawn) { } -void DerivedLevelData::setTime(__int64 time) +void DerivedLevelData::setTime(int64_t time) { } -void DerivedLevelData::setSizeOnDisk(__int64 sizeOnDisk) +void DerivedLevelData::setSizeOnDisk(int64_t sizeOnDisk) { } diff --git a/Minecraft.World/DerivedLevelData.h b/Minecraft.World/DerivedLevelData.h index a39f7d04..db5a72d2 100644 --- a/Minecraft.World/DerivedLevelData.h +++ b/Minecraft.World/DerivedLevelData.h @@ -16,27 +16,27 @@ protected: public: CompoundTag *createTag(); CompoundTag *createTag(vector > *players); - __int64 getSeed(); + int64_t getSeed(); int getXSpawn(); int getYSpawn(); int getZSpawn(); - __int64 getTime(); - __int64 getSizeOnDisk(); + int64_t getTime(); + int64_t getSizeOnDisk(); CompoundTag *getLoadedPlayerTag(); wstring getLevelName(); int getVersion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); bool isThundering(); int getThunderTime(); bool isRaining(); int getRainTime(); GameType *getGameType(); - void setSeed(__int64 seed); + void setSeed(int64_t seed); void setXSpawn(int xSpawn); void setYSpawn(int ySpawn); void setZSpawn(int zSpawn); - void setTime(__int64 time); - void setSizeOnDisk(__int64 sizeOnDisk); + void setTime(int64_t time); + void setSizeOnDisk(int64_t sizeOnDisk); void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); void setDimension(int dimension); void setSpawn(int xSpawn, int ySpawn, int zSpawn); diff --git a/Minecraft.World/Dimension.cpp b/Minecraft.World/Dimension.cpp index 35e66698..71e93a63 100644 --- a/Minecraft.World/Dimension.cpp +++ b/Minecraft.World/Dimension.cpp @@ -41,11 +41,11 @@ void Dimension::init() } else #endif - if (level->getLevelData()->getGenerator() == LevelType::lvl_flat) + if (level->getLevelData()->getGenerator() == LevelType::lvl_flat) { biomeSource = new FixedBiomeSource(Biome::plains, 0.5f, 0.5f); } - else + else { biomeSource = new BiomeSource(level); } @@ -77,11 +77,11 @@ ChunkSource *Dimension::createRandomLevelSource() const } else #endif - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return new FlatLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures()); - } - else + } + else { return new RandomLevelSource(level, level->getSeed(), level->getLevelData()->isGenerateMapFeatures()); } @@ -106,7 +106,7 @@ bool Dimension::isValidSpawn(int x, int z) const return true; } -float Dimension::getTimeOfDay(__int64 time, float a) const +float Dimension::getTimeOfDay(int64_t time, float a) const { int dayStep = (int) (time % Level::TICKS_PER_DAY); float td = (dayStep + a) / Level::TICKS_PER_DAY - 0.25f; @@ -118,7 +118,7 @@ float Dimension::getTimeOfDay(__int64 time, float a) const return td; } -int Dimension::getMoonPhase(__int64 time, float a) const +int Dimension::getMoonPhase(int64_t time, float a) const { return ((int) (time / Level::TICKS_PER_DAY)) % 8; } @@ -162,7 +162,7 @@ Vec3 *Dimension::getFogColor(float td, float a) const float br = Mth::cos(td * PI * 2) * 2 + 0.5f; if (br < 0.0f) br = 0.0f; if (br > 1.0f) br = 1.0f; - + unsigned int baseFogColour = Minecraft::GetInstance()->getColourTable()->getColor( eMinecraftColour_Default_Fog_Colour ); float r = ((baseFogColour >> 16) & 0xff) / 255.0f; float g = ((baseFogColour >> 8) & 0xff) / 255.0f; @@ -203,16 +203,16 @@ Pos *Dimension::getSpawnPos() return NULL; } -int Dimension::getSpawnYPosition() +int Dimension::getSpawnYPosition() { - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return 4; } return Level::genDepth / 2; } -bool Dimension::hasBedrockFog() +bool Dimension::hasBedrockFog() { // 4J-PB - turn off bedrock fog if the host player doesn't want it if(app.GetGameHostOption(eGameHostOption_BedrockFog)==0) @@ -223,9 +223,9 @@ bool Dimension::hasBedrockFog() return (levelType != LevelType::lvl_flat && !hasCeiling); } -double Dimension::getClearColorScale() +double Dimension::getClearColorScale() { - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return 1.0; } diff --git a/Minecraft.World/Dimension.h b/Minecraft.World/Dimension.h index 36df385e..5231c237 100644 --- a/Minecraft.World/Dimension.h +++ b/Minecraft.World/Dimension.h @@ -35,8 +35,8 @@ public: virtual bool isValidSpawn(int x, int z) const; - virtual float getTimeOfDay(__int64 time, float a) const; - virtual int getMoonPhase(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; + virtual int getMoonPhase(int64_t time, float a) const; virtual bool isNaturalDimension(); private: static const int fogColor = 0xc0d8ff; @@ -53,7 +53,7 @@ public: virtual Pos *getSpawnPos(); int getSpawnYPosition(); - virtual bool hasBedrockFog(); + virtual bool hasBedrockFog(); double getClearColorScale(); virtual bool isFoggyAt(int x, int z); diff --git a/Minecraft.World/DirectoryLevelStorage.cpp b/Minecraft.World/DirectoryLevelStorage.cpp index 27514c9b..5a1dfc0a 100644 --- a/Minecraft.World/DirectoryLevelStorage.cpp +++ b/Minecraft.World/DirectoryLevelStorage.cpp @@ -108,19 +108,19 @@ void _MapDataMappings_old::setMapping(int id, PlayerUID xuid, int dimension) #ifdef _LARGE_WORLDS void DirectoryLevelStorage::PlayerMappings::addMapping(int id, int centreX, int centreZ, int dimension, int scale) { - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); m_mappings[index] = id; //app.DebugPrintf("Adding mapping: %d - (%d,%d)/%d/%d [%I64d - 0x%016llx]\n", id, centreX, centreZ, dimension, scale, index, index); } bool DirectoryLevelStorage::PlayerMappings::getMapping(int &id, int centreX, int centreZ, int dimension, int scale) { - //__int64 zMasked = centreZ & 0x1FFFFFFF; - //__int64 xMasked = centreX & 0x1FFFFFFF; - //__int64 zShifted = zMasked << 34; - //__int64 xShifted = xMasked << 5; + //int64_t zMasked = centreZ & 0x1FFFFFFF; + //int64_t xMasked = centreX & 0x1FFFFFFF; + //int64_t zShifted = zMasked << 34; + //int64_t xShifted = xMasked << 5; //app.DebugPrintf("xShifted = %d (0x%016x), zShifted = %I64d (0x%016llx)\n", xShifted, xShifted, zShifted, zShifted); - __int64 index = ( ((__int64)(centreZ & 0x1FFFFFFF)) << 34) | ( ((__int64)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); + int64_t index = ( ((int64_t)(centreZ & 0x1FFFFFFF)) << 34) | ( ((int64_t)(centreX & 0x1FFFFFFF)) << 5) | ( (scale & 0x7) << 2) | (dimension & 0x3); AUTO_VAR(it,m_mappings.find(index)); if(it != m_mappings.end()) { @@ -151,7 +151,7 @@ void DirectoryLevelStorage::PlayerMappings::readMappings(DataInputStream *dis) int count = dis->readInt(); for(unsigned int i = 0; i < count; ++i) { - __int64 index = dis->readLong(); + int64_t index = dis->readLong(); int id = dis->readInt(); m_mappings[index] = id; app.DebugPrintf(" -- %lld (0x%016llx) = %d\n", index, index, id); @@ -233,7 +233,7 @@ ChunkStorage *DirectoryLevelStorage::createChunkStorage(Dimension *dimension) return new OldChunkStorage(dir, true); } -LevelData *DirectoryLevelStorage::prepareLevel() +LevelData *DirectoryLevelStorage::prepareLevel() { // 4J Stu Added #ifdef _LARGE_WORLDS @@ -295,7 +295,7 @@ LevelData *DirectoryLevelStorage::prepareLevel() #else if(getSaveFile()->getSaveVersion() < END_DIMENSION_MAP_MAPPINGS_SAVE_VERSION) - { + { MapDataMappings_old oldMapDataMappings; getSaveFile()->readFile( fileEntry, &oldMapDataMappings, // data buffer @@ -334,7 +334,7 @@ LevelData *DirectoryLevelStorage::prepareLevel() ConsoleSavePath dataFile = ConsoleSavePath( wstring( L"level.dat" ) ); - if ( m_saveFile->doesFileExist( dataFile ) ) + if ( m_saveFile->doesFileExist( dataFile ) ) { ConsoleSaveFileInputStream fis = ConsoleSaveFileInputStream(m_saveFile, dataFile); CompoundTag *root = NbtIo::readCompressed(&fis); @@ -429,7 +429,7 @@ void DirectoryLevelStorage::save(shared_ptr player) } // 4J Changed return val to bool to check if new player or loaded player -bool DirectoryLevelStorage::load(shared_ptr player) +bool DirectoryLevelStorage::load(shared_ptr player) { bool newPlayer = true; CompoundTag *tag = loadPlayerDataTag( player->getXuid() ); @@ -499,7 +499,7 @@ void DirectoryLevelStorage::clearOldPlayerFiles() m_saveFile->deleteFile( playerFiles->at(i) ); } } - else + else #endif if( playerFiles->size() > MAX_PLAYER_DATA_SAVES ) { @@ -523,12 +523,12 @@ void DirectoryLevelStorage::clearOldPlayerFiles() } } -PlayerIO *DirectoryLevelStorage::getPlayerIO() +PlayerIO *DirectoryLevelStorage::getPlayerIO() { return this; } -void DirectoryLevelStorage::closeAll() +void DirectoryLevelStorage::closeAll() { } @@ -582,7 +582,7 @@ void DirectoryLevelStorage::resetNetherPlayerPositions() // If the player is in the nether, set their y position above the top of the nether // This will force the player to be spawned in a valid position in the overworld when they are loaded if(tag->contains(L"Dimension") && tag->getInt(L"Dimension") == LevelData::DIMENSION_NETHER && tag->contains(L"Pos")) - { + { ListTag *pos = (ListTag *) tag->getList(L"Pos"); pos->get(1)->data = DBL_MAX; diff --git a/Minecraft.World/DirectoryLevelStorage.h b/Minecraft.World/DirectoryLevelStorage.h index 820ef31f..e47769d9 100644 --- a/Minecraft.World/DirectoryLevelStorage.h +++ b/Minecraft.World/DirectoryLevelStorage.h @@ -54,7 +54,7 @@ typedef struct _MapDataMappings_old void setMapping(int id, PlayerUID xuid, int dimension); } MapDataMappings_old; -class DirectoryLevelStorage : public LevelStorage, public PlayerIO +class DirectoryLevelStorage : public LevelStorage, public PlayerIO { private: /* 4J Jev, Probably no need for this as theres no exceptions being thrown. @@ -65,7 +65,7 @@ private: const ConsoleSavePath playerDir; //const File dataDir; const ConsoleSavePath dataDir; - const __int64 sessionId; + const int64_t sessionId; const wstring levelId; static const wstring sc_szPlayerDir; @@ -75,7 +75,7 @@ private: { friend class DirectoryLevelStorage; private: - unordered_map<__int64, short> m_mappings; + unordered_map m_mappings; public: void addMapping(int id, int centreX, int centreZ, int dimension, int scale); @@ -92,7 +92,7 @@ private: #else MapDataMappings m_mapDataMappings; MapDataMappings m_saveableMapDataMappings; -#endif +#endif bool m_bHasLoadedMapDataMappings; unordered_map m_cachedSaveData; diff --git a/Minecraft.World/EmptyLevelChunk.cpp b/Minecraft.World/EmptyLevelChunk.cpp index 80460b10..4934ac96 100644 --- a/Minecraft.World/EmptyLevelChunk.cpp +++ b/Minecraft.World/EmptyLevelChunk.cpp @@ -210,7 +210,7 @@ bool EmptyLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *EmptyLevelChunk::getRandom(__int64 l) +Random *EmptyLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/Minecraft.World/EmptyLevelChunk.h b/Minecraft.World/EmptyLevelChunk.h index 02ffc176..a8ff27f9 100644 --- a/Minecraft.World/EmptyLevelChunk.h +++ b/Minecraft.World/EmptyLevelChunk.h @@ -48,7 +48,7 @@ public: int getBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); bool isEmpty(); virtual void reSyncLighting() {}; // 4J added }; diff --git a/Minecraft.World/EnchantmentMenu.h b/Minecraft.World/EnchantmentMenu.h index e09b94c6..62408f1d 100644 --- a/Minecraft.World/EnchantmentMenu.h +++ b/Minecraft.World/EnchantmentMenu.h @@ -23,7 +23,7 @@ private: bool m_costsChanged; // 4J Added public: - __int64 nameSeed; + int64_t nameSeed; public: int costs[3]; diff --git a/Minecraft.World/FileHeader.h b/Minecraft.World/FileHeader.h index 203ec322..9205e5b4 100644 --- a/Minecraft.World/FileHeader.h +++ b/Minecraft.World/FileHeader.h @@ -96,7 +96,7 @@ public: }; - __int64 lastModifiedTime; // 8B + int64_t lastModifiedTime; // 8B }; typedef FileEntrySaveDataV2 FileEntrySaveData; @@ -122,7 +122,7 @@ public: currentFilePointer = data.startOffset; } - unsigned int getFileSize() { return data.length; } + unsigned int getFileSize() { return data.length; } bool isRegionFile() { return data.filename[0] == 0; } // When using ConsoleSaveFileSplit only unsigned int getRegionFileIndex() { return data.regionIndex; } // When using ConsoleSaveFileSplit only @@ -185,7 +185,7 @@ protected: vector *getDatFilesWithMacAndUserID(const PlayerUID& pUID); vector *getDatFilesWithPrimaryUser(); #endif - + void setSaveVersion(int version) { m_saveVersion = version; } int getSaveVersion() { return m_saveVersion; } void setOriginalSaveVersion(int version) { m_originalSaveVersion = version; } @@ -199,5 +199,5 @@ protected: void setEndian(ByteOrder endian) { m_saveEndian = endian; } static ByteOrder getEndian(ESavePlatform plat); bool isLocalEndianDifferent(ESavePlatform plat){return m_localEndian != getEndian(plat); } - + }; diff --git a/Minecraft.World/FileInputStream.cpp b/Minecraft.World/FileInputStream.cpp index 7c0e844f..5e0f6ca5 100644 --- a/Minecraft.World/FileInputStream.cpp +++ b/Minecraft.World/FileInputStream.cpp @@ -164,8 +164,8 @@ void FileInputStream::close() { //printf("\n\nFileInputStream::close - TRYING TO CLOSE AN INVALID FILE HANDLE\n\n"); return; - } - + } + BOOL result = CloseHandle( m_fileHandle ); if( result == 0 ) @@ -185,7 +185,7 @@ void FileInputStream::close() //n - the number of bytes to be skipped. //Returns: //the actual number of bytes skipped. -__int64 FileInputStream::skip(__int64 n) +int64_t FileInputStream::skip(int64_t n) { #ifdef _XBOX LARGE_INTEGER li; diff --git a/Minecraft.World/FileInputStream.h b/Minecraft.World/FileInputStream.h index e855a2d7..99ce776f 100644 --- a/Minecraft.World/FileInputStream.h +++ b/Minecraft.World/FileInputStream.h @@ -12,7 +12,7 @@ public: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n); + virtual int64_t skip(int64_t n); private: HANDLE m_fileHandle; diff --git a/Minecraft.World/FlatLevelSource.cpp b/Minecraft.World/FlatLevelSource.cpp index 6435bfb4..96b53312 100644 --- a/Minecraft.World/FlatLevelSource.cpp +++ b/Minecraft.World/FlatLevelSource.cpp @@ -11,7 +11,7 @@ //FlatLevelSource::villageFeature = new VillageFeature(1); -FlatLevelSource::FlatLevelSource(Level *level, __int64 seed, bool generateStructures) +FlatLevelSource::FlatLevelSource(Level *level, int64_t seed, bool generateStructures) { m_XZSize = level->getLevelData()->getXZSize(); @@ -32,26 +32,26 @@ FlatLevelSource::~FlatLevelSource() delete villageFeature; } -void FlatLevelSource::prepareHeights(byteArray blocks) +void FlatLevelSource::prepareHeights(byteArray blocks) { int height = blocks.length / (16 * 16); - for (int xc = 0; xc < 16; xc++) + for (int xc = 0; xc < 16; xc++) { - for (int zc = 0; zc < 16; zc++) + for (int zc = 0; zc < 16; zc++) { - for (int yc = 0; yc < height; yc++) + for (int yc = 0; yc < height; yc++) { int block = 0; - if (yc == 0) + if (yc == 0) { block = Tile::unbreakable_Id; - } - else if (yc <= 2) + } + else if (yc <= 2) { block = Tile::dirt_Id; - } - else if (yc == 3) + } + else if (yc == 3) { block = Tile::grass_Id; } @@ -61,12 +61,12 @@ void FlatLevelSource::prepareHeights(byteArray blocks) } } -LevelChunk *FlatLevelSource::create(int x, int z) +LevelChunk *FlatLevelSource::create(int x, int z) { return getChunk(x, z); } -LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) +LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) { // 4J - now allocating this with a physical alloc & bypassing general memory management so that it will get cleanly freed int chunksSize = Level::genDepth * 16 * 16; @@ -80,7 +80,7 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) // double[] temperatures = level.getBiomeSource().temperatures; - if (generateStructures) + if (generateStructures) { villageFeature->apply(this, level, xOffs, zOffs, blocks); } @@ -96,43 +96,43 @@ LevelChunk *FlatLevelSource::getChunk(int xOffs, int zOffs) } -bool FlatLevelSource::hasChunk(int x, int y) +bool FlatLevelSource::hasChunk(int x, int y) { return true; } -void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) +void FlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) { // 4J - changed from random to pprandom so we can run in parallel with getChunk etc. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); - if (generateStructures) + if (generateStructures) { villageFeature->postProcess(level, pprandom, xt, zt); } - + app.processSchematics(parent->getChunk(xt,zt)); } -bool FlatLevelSource::save(bool force, ProgressListener *progressListener) +bool FlatLevelSource::save(bool force, ProgressListener *progressListener) { return true; } -bool FlatLevelSource::tick() +bool FlatLevelSource::tick() { return false; } -bool FlatLevelSource::shouldSave() +bool FlatLevelSource::shouldSave() { return true; } -wstring FlatLevelSource::gatherStats() +wstring FlatLevelSource::gatherStats() { return L"FlatLevelSource"; } @@ -140,7 +140,7 @@ wstring FlatLevelSource::gatherStats() vector *FlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { Biome *biome = level->getBiome(x, z); - if (biome == NULL) + if (biome == NULL) { return NULL; } diff --git a/Minecraft.World/FlatLevelSource.h b/Minecraft.World/FlatLevelSource.h index 804a7b5a..0c15c9d9 100644 --- a/Minecraft.World/FlatLevelSource.h +++ b/Minecraft.World/FlatLevelSource.h @@ -24,13 +24,13 @@ private: boolean generateStructures; VillageFeature *villageFeature;// = new VillageFeature(1); -public: - FlatLevelSource(Level *level, __int64 seed, bool generateStructures); +public: + FlatLevelSource(Level *level, int64_t seed, bool generateStructures); ~FlatLevelSource(); -private: void prepareHeights(byteArray blocks); +private: void prepareHeights(byteArray blocks); -public: +public: virtual LevelChunk *create(int x, int z); virtual LevelChunk *getChunk(int xOffs, int zOffs); virtual bool hasChunk(int x, int y); diff --git a/Minecraft.World/FuzzyZoomLayer.cpp b/Minecraft.World/FuzzyZoomLayer.cpp index 65c6709e..54155ff5 100644 --- a/Minecraft.World/FuzzyZoomLayer.cpp +++ b/Minecraft.World/FuzzyZoomLayer.cpp @@ -2,7 +2,7 @@ #include "System.h" #include "net.minecraft.world.level.newbiome.layer.h" -FuzzyZoomLayer::FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +FuzzyZoomLayer::FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -61,7 +61,7 @@ int FuzzyZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrFuzzyZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrFuzzyZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptr result = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/FuzzyZoomLayer.h b/Minecraft.World/FuzzyZoomLayer.h index bc8f5e48..19526931 100644 --- a/Minecraft.World/FuzzyZoomLayer.h +++ b/Minecraft.World/FuzzyZoomLayer.h @@ -5,7 +5,7 @@ class FuzzyZoomLayer : public Layer { public: - FuzzyZoomLayer(__int64 seedMixup, shared_ptrparent); + FuzzyZoomLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); protected: @@ -13,5 +13,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/GZIPInputStream.h b/Minecraft.World/GZIPInputStream.h index f852518b..b9242576 100644 --- a/Minecraft.World/GZIPInputStream.h +++ b/Minecraft.World/GZIPInputStream.h @@ -13,5 +13,5 @@ public: virtual int read(byteArray b) { return stream->read( b ); }; virtual int read(byteArray b, unsigned int offset, unsigned int length) { return stream->read(b, offset, length); }; virtual void close() { return stream->close(); }; - virtual __int64 skip(__int64 n) { return 0; }; + virtual int64_t skip(int64_t n) { return 0; }; }; \ No newline at end of file diff --git a/Minecraft.World/GrowMushroomIslandLayer.cpp b/Minecraft.World/GrowMushroomIslandLayer.cpp index 14857366..d204502d 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.cpp +++ b/Minecraft.World/GrowMushroomIslandLayer.cpp @@ -3,7 +3,7 @@ #include "net.minecraft.world.level.biome.h" -GrowMushroomIslandLayer::GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent) : Layer(seedMixup) +GrowMushroomIslandLayer::GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent) : Layer(seedMixup) { this->parent = parent; } @@ -25,10 +25,10 @@ intArray GrowMushroomIslandLayer::getArea(int xo, int yo, int w, int h) int n2 = p[(x + 2) + (y + 0) * pw]; int n3 = p[(x + 0) + (y + 2) * pw]; int n4 = p[(x + 2) + (y + 2) * pw]; - + int c = p[(x + 1) + (y + 1) * pw]; - if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) ) + if( ( n1 == Biome::mushroomIsland->id ) || ( n2 == Biome::mushroomIsland->id ) || ( n3 == Biome::mushroomIsland->id ) || ( n4 == Biome::mushroomIsland->id ) ) { result[x + y * w] = Biome::mushroomIsland->id; } diff --git a/Minecraft.World/GrowMushroomIslandLayer.h b/Minecraft.World/GrowMushroomIslandLayer.h index 3bca4d5c..6b0860f7 100644 --- a/Minecraft.World/GrowMushroomIslandLayer.h +++ b/Minecraft.World/GrowMushroomIslandLayer.h @@ -4,6 +4,6 @@ class GrowMushroomIslandLayer : public Layer { public: - GrowMushroomIslandLayer(__int64 seedMixup, shared_ptr parent); + GrowMushroomIslandLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/HellDimension.cpp b/Minecraft.World/HellDimension.cpp index 85e2a25a..63cb0df7 100644 --- a/Minecraft.World/HellDimension.cpp +++ b/Minecraft.World/HellDimension.cpp @@ -48,7 +48,7 @@ ChunkSource *HellDimension::createRandomLevelSource() const } else #endif - if (levelType == LevelType::lvl_flat) + if (levelType == LevelType::lvl_flat) { return new HellFlatLevelSource(level, level->getSeed()); } @@ -68,7 +68,7 @@ bool HellDimension::isValidSpawn(int x, int z) const return false; } -float HellDimension::getTimeOfDay(__int64 time, float a) const +float HellDimension::getTimeOfDay(int64_t time, float a) const { return 0.5f; } diff --git a/Minecraft.World/HellDimension.h b/Minecraft.World/HellDimension.h index b37f2b53..fa95d9b2 100644 --- a/Minecraft.World/HellDimension.h +++ b/Minecraft.World/HellDimension.h @@ -14,7 +14,7 @@ public: virtual ChunkSource *createRandomLevelSource() const; virtual bool isNaturalDimension(); virtual bool isValidSpawn(int x, int y) const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual bool mayRespawn() const; virtual bool isFoggyAt(int x, int z); diff --git a/Minecraft.World/HellFlatLevelSource.cpp b/Minecraft.World/HellFlatLevelSource.cpp index 0b1c4359..14b29f8c 100644 --- a/Minecraft.World/HellFlatLevelSource.cpp +++ b/Minecraft.World/HellFlatLevelSource.cpp @@ -4,7 +4,7 @@ #include "net.minecraft.world.level.storage.h" #include "HellFlatLevelSource.h" -HellFlatLevelSource::HellFlatLevelSource(Level *level, __int64 seed) +HellFlatLevelSource::HellFlatLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -26,17 +26,17 @@ void HellFlatLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) { int height = blocks.length / (16 * 16); - for (int xc = 0; xc < 16; xc++) + for (int xc = 0; xc < 16; xc++) { - for (int zc = 0; zc < 16; zc++) + for (int zc = 0; zc < 16; zc++) { - for (int yc = 0; yc < height; yc++) + for (int yc = 0; yc < height; yc++) { int block = 0; if ( (yc <= 6) || ( yc >= 121 ) ) { block = Tile::hellRock_Id; - } + } blocks[xc << 11 | zc << 7 | yc] = (byte) block; } @@ -159,8 +159,8 @@ void HellFlatLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); int count = pprandom->nextInt(pprandom->nextInt(10) + 1) + 1; @@ -211,7 +211,7 @@ wstring HellFlatLevelSource::gatherStats() vector *HellFlatLevelSource::getMobsAt(MobCategory *mobCategory, int x, int y, int z) { Biome *biome = level->getBiome(x, z); - if (biome == NULL) + if (biome == NULL) { return NULL; } diff --git a/Minecraft.World/HellFlatLevelSource.h b/Minecraft.World/HellFlatLevelSource.h index b756d9a6..c1bd5868 100644 --- a/Minecraft.World/HellFlatLevelSource.h +++ b/Minecraft.World/HellFlatLevelSource.h @@ -26,7 +26,7 @@ private: Level *level; public: - HellFlatLevelSource(Level *level, __int64 seed); + HellFlatLevelSource(Level *level, int64_t seed); ~HellFlatLevelSource(); private: diff --git a/Minecraft.World/HellRandomLevelSource.cpp b/Minecraft.World/HellRandomLevelSource.cpp index 10194f7d..3d67d0f8 100644 --- a/Minecraft.World/HellRandomLevelSource.cpp +++ b/Minecraft.World/HellRandomLevelSource.cpp @@ -7,7 +7,7 @@ #include "BiomeSource.h" #include "HellRandomLevelSource.h" -HellRandomLevelSource::HellRandomLevelSource(Level *level, __int64 seed) +HellRandomLevelSource::HellRandomLevelSource(Level *level, int64_t seed) { int xzSize = level->getLevelData()->getXZSize(); int hellScale = level->getLevelData()->getHellScale(); @@ -224,7 +224,7 @@ void HellRandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks if(random->nextInt(16) == 0) { top = (byte) Tile::netherStalk_Id; - + // Place the nether wart on top of the soul sand y += 1; int genDepthMinusOne = Level::genDepthMinusOne; // Take into local int for PS4 as min takes a reference to the const int there and then needs the value to exist for the linker @@ -430,8 +430,8 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) // we need to use a separate random - have used the same initialisation code as used in RandomLevelSource::postProcess to make sure this random value // is consistent for each world generation. Also changed all uses of random here to pprandom. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); netherBridgeFeature->postProcess(level, pprandom, xt, zt); @@ -497,7 +497,7 @@ void HellRandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } HeavyTile::instaFall = false; - + app.processSchematics(parent->getChunk(xt,zt)); } diff --git a/Minecraft.World/HellRandomLevelSource.h b/Minecraft.World/HellRandomLevelSource.h index 0587e86a..634d1828 100644 --- a/Minecraft.World/HellRandomLevelSource.h +++ b/Minecraft.World/HellRandomLevelSource.h @@ -37,7 +37,7 @@ private: Level *level; public: - HellRandomLevelSource(Level *level, __int64 seed); + HellRandomLevelSource(Level *level, int64_t seed); ~HellRandomLevelSource(); NetherBridgeFeature *netherBridgeFeature; @@ -68,5 +68,5 @@ public: wstring gatherStats(); virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/InputStream.h b/Minecraft.World/InputStream.h index af0ff593..234e85b5 100644 --- a/Minecraft.World/InputStream.h +++ b/Minecraft.World/InputStream.h @@ -11,7 +11,7 @@ public: virtual int read(byteArray b) = 0; virtual int read(byteArray b, unsigned int offset, unsigned int length) = 0; virtual void close() = 0; - virtual __int64 skip(__int64 n) = 0; + virtual int64_t skip(int64_t n) = 0; static InputStream *getResourceAsStream(const wstring &fileName); }; \ No newline at end of file diff --git a/Minecraft.World/IslandLayer.cpp b/Minecraft.World/IslandLayer.cpp index b502f384..0a6cc3fa 100644 --- a/Minecraft.World/IslandLayer.cpp +++ b/Minecraft.World/IslandLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -IslandLayer::IslandLayer(__int64 seedMixup) : Layer(seedMixup) +IslandLayer::IslandLayer(int64_t seedMixup) : Layer(seedMixup) { } diff --git a/Minecraft.World/IslandLayer.h b/Minecraft.World/IslandLayer.h index 09e90eb3..90995636 100644 --- a/Minecraft.World/IslandLayer.h +++ b/Minecraft.World/IslandLayer.h @@ -5,7 +5,7 @@ class IslandLayer : public Layer { public: - IslandLayer(__int64 seedMixup); + IslandLayer(int64_t seedMixup); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/JavaMath.cpp b/Minecraft.World/JavaMath.cpp index 92843695..87778c56 100644 --- a/Minecraft.World/JavaMath.cpp +++ b/Minecraft.World/JavaMath.cpp @@ -34,9 +34,9 @@ double Math::random() //a - a floating-point value to be rounded to a long. //Returns: //the value of the argument rounded to the nearest long value. -__int64 Math::round( double d ) +int64_t Math::round( double d ) { - return (__int64)floor( d + 0.5 ); + return (int64_t)floor( d + 0.5 ); } int Math::_max(int a, int b) @@ -59,7 +59,7 @@ float Math::_min(float a, float b) return a < b ? a : b; } -float Math::wrapDegrees(float input) +float Math::wrapDegrees(float input) { while(input>=360.0f)input-=360.0f; if (input >= 180.0f) input -= 360.0f; @@ -67,7 +67,7 @@ float Math::wrapDegrees(float input) return input; } -double Math::wrapDegrees(double input) +double Math::wrapDegrees(double input) { while(input>=360.0)input-=360.0; if (input >= 180.0) input -= 360.0; diff --git a/Minecraft.World/JavaMath.h b/Minecraft.World/JavaMath.h index fcd095c8..b64832e9 100644 --- a/Minecraft.World/JavaMath.h +++ b/Minecraft.World/JavaMath.h @@ -8,7 +8,7 @@ private: public: static double random(); - static __int64 round( double d ); + static int64_t round( double d ); static int _max(int a, int b); static float _max(float a, float b); static int _min(int a, int b); diff --git a/Minecraft.World/LargeCaveFeature.cpp b/Minecraft.World/LargeCaveFeature.cpp index 20b83a30..4db3ca3a 100644 --- a/Minecraft.World/LargeCaveFeature.cpp +++ b/Minecraft.World/LargeCaveFeature.cpp @@ -4,12 +4,12 @@ #include "net.minecraft.world.level.biome.h" #include "LargeCaveFeature.h" -void LargeCaveFeature::addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) +void LargeCaveFeature::addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom) { addTunnel(seed, xOffs, zOffs, blocks, xRoom, yRoom, zRoom, 1 + random->nextFloat() * 6, 0, 0, -1, -1, 0.5); } -void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) +void LargeCaveFeature::addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale) { double xMid = xOffs * 16 + 8; double zMid = zOffs * 16 + 8; @@ -123,7 +123,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b } if (detectedWater) continue; - for (int xx = x0; xx < x1; xx++) + for (int xx = x0; xx < x1; xx++) { double xd = ((xx + xOffs * 16 + 0.5) - xCave) / rad; for (int zz = z0; zz < z1; zz++) @@ -142,7 +142,7 @@ void LargeCaveFeature::addTunnel(__int64 seed, int xOffs, int zOffs, byteArray b if (block == Tile::grass_Id) hasGrass = true; if (block == Tile::rock_Id || block == Tile::dirt_Id || block == Tile::grass_Id) { - if (yy < 10) + if (yy < 10) { blocks[p] = (byte) Tile::lava_Id; } diff --git a/Minecraft.World/LargeCaveFeature.h b/Minecraft.World/LargeCaveFeature.h index 5188aca7..66eadde9 100644 --- a/Minecraft.World/LargeCaveFeature.h +++ b/Minecraft.World/LargeCaveFeature.h @@ -5,7 +5,7 @@ class LargeCaveFeature : public LargeFeature { protected: - void addRoom(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); - void addTunnel(__int64 seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); + void addRoom(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xRoom, double yRoom, double zRoom); + void addTunnel(int64_t seed, int xOffs, int zOffs, byteArray blocks, double xCave, double yCave, double zCave, float thickness, float yRot, float xRot, int step, int dist, double yScale); virtual void addFeature(Level *level, int x, int z, int xOffs, int zOffs, byteArray blocks); }; diff --git a/Minecraft.World/LargeFeature.cpp b/Minecraft.World/LargeFeature.cpp index 2e43fac7..23dc532f 100644 --- a/Minecraft.World/LargeFeature.cpp +++ b/Minecraft.World/LargeFeature.cpp @@ -21,15 +21,15 @@ void LargeFeature::apply(ChunkSource *ChunkSource, Level *level, int xOffs, int this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); for (int x = xOffs - r; x <= xOffs + r; x++) { for (int z = zOffs - r; z <= zOffs + r; z++) { - __int64 xx = x * xScale; - __int64 zz = z * zScale; + int64_t xx = x * xScale; + int64_t zz = z * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, x, z, xOffs, zOffs, blocks); } diff --git a/Minecraft.World/Layer.cpp b/Minecraft.World/Layer.cpp index 1d010e72..ca805912 100644 --- a/Minecraft.World/Layer.cpp +++ b/Minecraft.World/Layer.cpp @@ -16,7 +16,7 @@ libdivide::divider fast_d7(7); libdivide::divider fast_d10(10); #endif -LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) +LayerArray Layer::getDefaultLayers(int64_t seed, LevelType *levelType) { // 4J - Some changes moved here from 1.2.3. Temperature & downfall layers are no longer created & returned, and a debug layer is isn't. // For reference with regard to future merging, things NOT brought forward from the 1.2.3 version are new layer types that we @@ -58,7 +58,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) biomeLayer = shared_ptr(new ZoomLayer(1000 + i, biomeLayer)); if (i == 0) biomeLayer = shared_ptr(new AddIslandLayer(3, biomeLayer)); - + if (i == 0) { // 4J - moved mushroom islands to here. This skips 3 zooms that the old location of the add was, making them about 1/8 of the original size. Adding @@ -68,13 +68,13 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) } if (i == 1 ) - { + { // 4J - now expand mushroom islands up again. This does a simple region grow to add a new mushroom island element when any of the neighbours are also mushroom islands. // This helps make the islands into nice compact shapes of the type that are actually likely to be able to make an island out of the sea in a small space. Also // helps the shore layer from doing too much damage in shrinking the islands we are making - biomeLayer = shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); + biomeLayer = shared_ptr(new GrowMushroomIslandLayer(5, biomeLayer)); // Note - this reduces the size of mushroom islands by turning their edges into shores. We are doing this at i == 1 rather than i == 0 as the original does - biomeLayer = shared_ptr(new ShoreLayer(1000, biomeLayer)); + biomeLayer = shared_ptr(new ShoreLayer(1000, biomeLayer)); biomeLayer = shared_ptr(new SwampRiversLayer(1000, biomeLayer)); } @@ -107,7 +107,7 @@ LayerArray Layer::getDefaultLayers(__int64 seed, LevelType *levelType) return result; } -Layer::Layer(__int64 seedMixup) +Layer::Layer(int64_t seedMixup) { parent = nullptr; @@ -120,7 +120,7 @@ Layer::Layer(__int64 seedMixup) this->seedMixup += seedMixup; } -void Layer::init(__int64 seed) +void Layer::init(int64_t seed) { this->seed = seed; if (parent != NULL) parent->init(seed); @@ -132,7 +132,7 @@ void Layer::init(__int64 seed) this->seed += seedMixup; } -void Layer::initRandom(__int64 x, __int64 y) +void Layer::initRandom(int64_t x, int64_t y) { rval = seed; rval *= rval * 6364136223846793005l + 1442695040888963407l; diff --git a/Minecraft.World/Layer.h b/Minecraft.World/Layer.h index a444a629..6f31e94a 100644 --- a/Minecraft.World/Layer.h +++ b/Minecraft.World/Layer.h @@ -11,22 +11,22 @@ class LevelType; class Layer { private: - __int64 seed; + int64_t seed; protected: shared_ptrparent; private: - __int64 rval; - __int64 seedMixup; + int64_t rval; + int64_t seedMixup; public: - static LayerArray getDefaultLayers(__int64 seed, LevelType *levelType); + static LayerArray getDefaultLayers(int64_t seed, LevelType *levelType); - Layer(__int64 seedMixup); + Layer(int64_t seedMixup); - virtual void init(__int64 seed); - virtual void initRandom(__int64 x, __int64 y); + virtual void init(int64_t seed); + virtual void initRandom(int64_t x, int64_t y); protected: int nextRandom(int max); diff --git a/Minecraft.World/Level.cpp b/Minecraft.World/Level.cpp index 4b6a64f5..c159ecb8 100644 --- a/Minecraft.World/Level.cpp +++ b/Minecraft.World/Level.cpp @@ -112,7 +112,7 @@ void Level::initCache(lightCache_t *cache) } // Set a brightness value, going through the cache if enabled for this thread -void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) +void inline Level::setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness) { if( cache == NULL ) { @@ -129,8 +129,8 @@ void inline Level::setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -188,8 +188,8 @@ inline int Level::getBrightnessCached(lightCache_t *cache, LightLayer::variety l ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -255,8 +255,8 @@ inline int Level::getEmissionCached(lightCache_t *cache, int ct, int x, int y, i ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -285,7 +285,7 @@ inline int Level::getEmissionCached(lightCache_t *cache, int ct, int x, int y, i #endif setBrightness(LightLayer::Block, xx, yy, zz, val, true); } - + // Update both emission & blocking values whilst we are here cacheValue = posbits | EMISSION_VALID | BLOCKING_VALID; int t = getTile(x,y,z); @@ -331,8 +331,8 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay ( ( z & 0x3f0 ) >> 4 ); #ifdef _LARGE_WORLDS // Add in the higher bits for x and z - posbits |= ( ( ((__uint64)x) & 0x3FFFC00L) << 38) | - ( ( ((__uint64)z) & 0x3FFFC00L) << 22); + posbits |= ( ( ((uint64_t)x) & 0x3FFFC00L) << 38) | + ( ( ((uint64_t)z) & 0x3FFFC00L) << 22); #endif lightCache_t cacheValue = cache[idx]; @@ -361,7 +361,7 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay #endif setBrightness(layer, xx, yy, zz, val, true); } - + // Update both emission & blocking values whilst we are here cacheValue = posbits | EMISSION_VALID | BLOCKING_VALID; int t = getTile(x,y,z); @@ -394,7 +394,7 @@ inline int Level::getBlockingCached(lightCache_t *cache, LightLayer::variety lay // this hasn't been updated (for client threads) for each individual lighting update as would have been the case with the non-cached lighting. There's two reasons for this // (1) it's more efficient, since we aren't doing so many individual calls to the level listener to let the renderer know what has been updated // (2) it lets the lighting actually complete before we get any visual representation of the update, otherwise we end up seeing some strange partial updates -void Level::flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer) +void Level::flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer) { // cacheUse has a single bit for each x, y and z to say whether anything with that x, y or z has been written to if( cacheUse == 0 ) return; @@ -596,7 +596,7 @@ Level::Level(Level *level, Dimension *dimension) this->levelData = new LevelData(level->levelData); if( !this->levelData->useNewSeaLevel() ) seaLevel = Level::genDepth / 2; // 4J added - sea level is one unit lower since 1.8.2, maintain older height for old levels this->savedDataStorage = new SavedDataStorage( levelStorage.get() ); - + shared_ptr savedVillages = dynamic_pointer_cast(savedDataStorage->get(typeid(Villages), Villages::VILLAGE_FILE_ID)); if (savedVillages == NULL) { @@ -660,7 +660,7 @@ void Level::_init(shared_ptrlevelStorage, const wstring& levelName //{ // dimension = Dimension::getNew(levelData->getDimension()); //} - else + else { dimension = Dimension::getNew(0); } @@ -676,7 +676,7 @@ void Level::_init(shared_ptrlevelStorage, const wstring& levelName if( !this->levelData->useNewSeaLevel() ) seaLevel = Level::genDepth / 2; // 4J added - sea level is one unit lower since 1.8.2, maintain older height for old levels ((Dimension *) dimension)->init( this ); - + chunkSource = doCreateChunkSource ? createChunkSource() : NULL; // 4J - added flag so chunk source can be called from derived class instead // 4J Stu- Moved to derived classes @@ -707,7 +707,7 @@ Level::~Level() DeleteCriticalSection(&m_checkLightCS); // 4J-PB - savedDataStorage is shared between overworld and nether levels in the server, so it will already have been deleted on the first level delete - if(savedDataStorage!=NULL) delete savedDataStorage; + if(savedDataStorage!=NULL) delete savedDataStorage; DeleteCriticalSection(&m_entitiesCS); DeleteCriticalSection(&m_tileEntityListCS); @@ -1298,7 +1298,7 @@ int Level::getBrightness(LightLayer::variety layer, int x, int y, int z) // the level chunk once void Level::getNeighbourBrightnesses(int *brightnesses, LightLayer::variety layer, int x, int y, int z) { - if( ( ( ( x & 15 ) == 0 ) || ( ( x & 15 ) == 15 ) ) || + if( ( ( ( x & 15 ) == 0 ) || ( ( x & 15 ) == 15 ) ) || ( ( ( z & 15 ) == 0 ) || ( ( z & 15 ) == 15 ) ) || ( ( y <= 0 ) || ( y >= 127 ) ) ) { @@ -1591,7 +1591,7 @@ void Level::playSound(shared_ptr entity, int iSound, float volume, float if(entity->GetType() == eTYPE_SERVERPLAYER) { //app.DebugPrintf("ENTITY is serverplayer\n"); - + (*it)->playSound(entity,iSound, entity->x, entity->y - entity->heightOffset, entity->z, volume, pitch); } else @@ -1630,7 +1630,7 @@ void Level::playMusic(double x, double y, double z, const wstring& string, float { } -// 4J removed - +// 4J removed - /* void Level::addParticle(const wstring& id, double x, double y, double z, double xd, double yd, double zd) { @@ -2255,7 +2255,7 @@ void Level::tickEntities() { entityRemoved(*it); } - // + // entitiesToRemove.clear(); //for (int i = 0; i < entities.size(); i++) @@ -2268,7 +2268,7 @@ void Level::tickEntities() for (unsigned int i = 0; i < entities.size(); ) { shared_ptr e = entities.at(i); - + if (e->riding != NULL) { if (e->riding->removed || e->riding->rider.lock() != e) @@ -2287,7 +2287,7 @@ void Level::tickEntities() { #ifndef _FINAL_BUILD if(!( app.DebugSettingsOn() && app.GetMobsDontTickEnabled() && (dynamic_pointer_cast(e) != NULL) && (dynamic_pointer_cast(e) == NULL))) -#endif +#endif { tick(e); } @@ -2360,7 +2360,7 @@ void Level::tickEntities() // 4J-PB - Stuart - check this is correct here if (!tileEntitiesToUnload.empty()) - { + { //tileEntityList.removeAll(tileEntitiesToUnload); for( AUTO_VAR(it, tileEntityList.begin()); it != tileEntityList.end(); ) @@ -2767,7 +2767,7 @@ shared_ptr Level::explode(shared_ptr source, double x, double shared_ptr Level::explode(shared_ptr source, double x, double y, double z, float r, bool fire, bool destroyBlocks) { shared_ptr explosion = shared_ptr( new Explosion(this, source, x, y, z, r) ); - explosion->fire = fire; + explosion->fire = fire; explosion->destroyBlocks = destroyBlocks; explosion->explode(); explosion->finalizeExplosion(true); @@ -2945,7 +2945,7 @@ bool Level::isSolidRenderTile(int x, int y, int z) { Tile *tile = Tile::tiles[getTile(x, y, z)]; if (tile == NULL) return false; - + // 4J - addition here to make rendering big blocks of leaves more efficient. Normally leaves never consider themselves as solid, so // blocks of leaves will have all sides of each block completely visible. Changing to consider as solid if this block is surrounded by // other leaves (or solid things). This is paired with another change in Tile::getTexture which makes such solid tiles actually visibly solid (these @@ -3008,7 +3008,7 @@ bool Level::isTopSolidBlocking(int x, int y, int z) if (tile == NULL) return false; if (tile->material->isSolidBlocking() && tile->isCubeShaped()) return true; - if (dynamic_cast(tile) != NULL) + if (dynamic_cast(tile) != NULL) { return (getData(x, y, z) & StairTile::UPSIDEDOWN_BIT) == StairTile::UPSIDEDOWN_BIT; } @@ -3159,7 +3159,7 @@ void Level::toggleDownfall() void Level::buildAndPrepareChunksToPoll() { -#if 0 +#if 0 AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) { @@ -3205,7 +3205,7 @@ void Level::buildAndPrepareChunksToPoll() delete [] xx; delete [] zz; #endif - + if (delayUntilNextMoodSound > 0) delayUntilNextMoodSound--; // 4J Stu - Added 1.2.3, but not sure if we want to do it @@ -3387,7 +3387,7 @@ inline int GetIndex(int x, int y, int z) void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool force, bool rootOnlyEmissive) { lightCache_t *cache = (lightCache_t *)TlsGetValue(tlsIdxLightCache); - __uint64 cacheUse = 0; + uint64_t cacheUse = 0; if( force ) { @@ -3416,7 +3416,7 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool f EnterCriticalSection(&m_checkLightCS); #ifdef __PSVITA__ - // AP - only clear the one array element required to check if something has changed + // AP - only clear the one array element required to check if something has changed cachewritten = false; if( cache != NULL ) { @@ -3450,7 +3450,7 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool f #endif // If we're in cached mode, then use memory allocated after the cached data itself for the toCheck array, in an attempt to make both that & the other cached data sit on the CPU L2 cache better. - + int *toCheck; if( cache == NULL ) { @@ -3477,7 +3477,7 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool f // Lock 128K of cache (containing all the lighting cache + first 112K of toCheck array) on L2 to try and stop any cached data getting knocked out of L2 by other non-cached reads (or vice-versa) // if( cache ) XLockL2(XLOCKL2_INDEX_TITLE, cache, 128 * 1024, XLOCKL2_LOCK_SIZE_1_WAY, 0 ); - + { int cc = getBrightnessCached(cache, layer, xc, yc, zc); int ex = 0; @@ -3713,7 +3713,7 @@ void Level::checkLight(LightLayer::variety layer, int xc, int yc, int zc, bool f ///////////////////////////////////////////////////////////////// #endif LeaveCriticalSection(&m_checkLightCS); - + } @@ -3905,7 +3905,7 @@ unsigned int Level::countInstanceOfInRange(eINSTANCEOF clas, bool singleType, in for (AUTO_VAR(it, entities.begin()); it != itEnd; it++) { shared_ptr e = *it;//entities.at(i); - + float sd = e->distanceTo(x,y,z); if (sd * sd > range * range) { @@ -4149,7 +4149,7 @@ shared_ptr Level::getNearestAttackablePlayer(shared_ptr source, shared_ptr Level::getNearestAttackablePlayer(double x, double y, double z, double maxDist) { double best = -1; - + shared_ptr result = nullptr; AUTO_VAR(itEnd, players.end()); for (AUTO_VAR(it, players.begin()); it != itEnd; it++) @@ -4179,7 +4179,7 @@ shared_ptr Level::getNearestAttackablePlayer(double x, double y, double } visibleDist *= (.7f * coverPercentage); } - + // 4J Stu - Added check that this player is still alive and privilege check if ((visibleDist < 0 || dist < visibleDist * visibleDist) && (best == -1 || dist < best) && p->isAlive() && !p->hasInvisiblePrivilege()) { @@ -4318,16 +4318,16 @@ void Level::checkSession() } -void Level::setTime(__int64 time) +void Level::setTime(int64_t time) { // 4J : WESTY : Added to track game time played by players for other awards. if (time != 0) // Ignore setting time to 0, done at level start and during tutorial. { // Determine step in time and ensure it is reasonable ( we only have an int to store the player stat). - __int64 timeDiff = time - levelData->getTime(); - + int64_t timeDiff = time - levelData->getTime(); + // debug setting added to keep it at day time -#ifndef _FINAL_BUILD +#ifndef _FINAL_BUILD if(app.DebugSettingsOn()) { if(app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<levelData->setTime(time); } -void Level::setOverrideTimeOfDay(__int64 time) +void Level::setOverrideTimeOfDay(int64_t time) { m_timeOfDayOverride = time; } -__int64 Level::getSeed() +int64_t Level::getSeed() { return levelData->getSeed(); } -__int64 Level::getTime() +int64_t Level::getTime() { return levelData->getTime(); } @@ -4529,7 +4529,7 @@ int Level::getAuxValueForMap(PlayerUID xuid, int dimension, int centreXC, int ce return savedDataStorage->getAuxValueForMap(xuid, dimension, centreXC, centreZC, scale); } -// void Level::globalLevelEvent(int type, int sourceX, int sourceY, int sourceZ, int data) +// void Level::globalLevelEvent(int type, int sourceX, int sourceY, int sourceZ, int data) // { // auto itEnd = listeners.end(); // for (auto it = listeners.begin(); it != itEnd; it++) @@ -4565,7 +4565,7 @@ int Level::getHeight() Random *Level::getRandomFor(int x, int z, int blend) { - __int64 seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; + int64_t seed = (x * 341873128712l + z * 132897987541l) + getLevelData()->getSeed() + blend; random->setSeed(seed); return random; } @@ -4585,9 +4585,9 @@ bool Level::isAllEmpty() return false; } -double Level::getHorizonHeight() +double Level::getHorizonHeight() { - if (levelData->getGenerator() == LevelType::lvl_flat) + if (levelData->getGenerator() == LevelType::lvl_flat) { return 0.0; } diff --git a/Minecraft.World/Level.h b/Minecraft.World/Level.h index 361a40e8..ecafc02b 100644 --- a/Minecraft.World/Level.h +++ b/Minecraft.World/Level.h @@ -133,7 +133,7 @@ public: Random *random; bool isNew; Dimension *dimension; - + protected: vector listeners; @@ -239,26 +239,26 @@ public: void setBrightnessNoUpdateOnClient(LightLayer::variety layer, int x, int y, int z, int brightness); // 4J added #ifdef _LARGE_WORLDS - typedef __uint64 lightCache_t; + typedef uint64_t lightCache_t; #else typedef unsigned int lightCache_t; #endif - inline void setBrightnessCached(lightCache_t *cache, __uint64 *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); + inline void setBrightnessCached(lightCache_t *cache, uint64_t *cacheUse, LightLayer::variety layer, int x, int y, int z, int brightness); inline int getBrightnessCached(lightCache_t *cache, LightLayer::variety layer, int x, int y, int z); inline int getEmissionCached(lightCache_t *cache, int ct, int x, int y, int z); inline int getBlockingCached(lightCache_t *cache, LightLayer::variety layer, int *ct, int x, int y, int z); void initCache(lightCache_t *cache); - void flushCache(lightCache_t *cache, __uint64 cacheUse, LightLayer::variety layer); + void flushCache(lightCache_t *cache, uint64_t cacheUse, LightLayer::variety layer); bool cachewritten; static const int LIGHTING_SHIFT = 24; static const int BLOCKING_SHIFT = 20; static const int EMISSION_SHIFT = 16; #ifdef _LARGE_WORLDS - static const __int64 LIGHTING_WRITEBACK = 0x80000000LL; - static const __int64 EMISSION_VALID = 0x40000000LL; - static const __int64 BLOCKING_VALID = 0x20000000LL; - static const __int64 LIGHTING_VALID = 0x10000000LL; + static const int64_t LIGHTING_WRITEBACK = 0x80000000LL; + static const int64_t EMISSION_VALID = 0x40000000LL; + static const int64_t BLOCKING_VALID = 0x20000000LL; + static const int64_t LIGHTING_VALID = 0x10000000LL; static const lightCache_t POSITION_MASK = 0xffffffff0000ffffLL; #else static const int LIGHTING_WRITEBACK = 0x80000000; @@ -402,7 +402,7 @@ public: bool shouldSnow(int x, int y, int z); void checkLight(int x, int y, int z, bool force = false, bool rootOnlyEmissive = false); // 4J added force, rootOnlySource parameters private: - int *toCheckLevel; + int *toCheckLevel; int getExpectedSkyColor(lightCache_t *cache, int oc, int x, int y , int z, int ct, int block); int getExpectedBlockColor(lightCache_t *cache, int oc, int x, int y, int z, int ct, int block, bool propagatedOnly); // 4J added parameter public: @@ -449,10 +449,10 @@ public: void setBlocksAndData(int x, int y, int z, int xs, int ys, int zs, byteArray data, bool includeLighting = true); virtual void disconnect(bool sendDisconnect = true); void checkSession(); - void setTime(__int64 time); - void setOverrideTimeOfDay(__int64 time); // 4J Added so we can override timeOfDay without changing tick time - __int64 getSeed(); - __int64 getTime(); + void setTime(int64_t time); + void setOverrideTimeOfDay(int64_t time); // 4J Added so we can override timeOfDay without changing tick time + int64_t getSeed(); + int64_t getTime(); Pos *getSharedSpawnPos(); void setSpawnPos(int x, int y, int z); void setSpawnPos(Pos *spawnPos); @@ -496,7 +496,7 @@ public: // 4J added - __int64 m_timeOfDayOverride; + int64_t m_timeOfDayOverride; // 4J - optimisation - keep direct reference of underlying cache here LevelChunk **chunkSourceCache; diff --git a/Minecraft.World/LevelChunk.cpp b/Minecraft.World/LevelChunk.cpp index 823c7c4c..332f12f5 100644 --- a/Minecraft.World/LevelChunk.cpp +++ b/Minecraft.World/LevelChunk.cpp @@ -51,7 +51,7 @@ void LevelChunk::init(Level *level, int x, int z) biomes = byteArray(16 * 16); for(int i = 0; i < 16 * 16; i++ ) { - biomes[i] = 0xff; + biomes[i] = 0xff; } #ifdef _ENTITIES_RW_SECTION EnterCriticalRWSection(&m_csEntities, true); @@ -103,12 +103,12 @@ void LevelChunk::init(Level *level, int x, int z) // Optimisation brought forward from 1.8.2, change from int to unsigned char & this special value changed from -999 to 255 for(int i = 0; i < 16 * 16; i++ ) { - rainHeights[i] = 255; + rainHeights[i] = 255; } // 4J - lighting change brought forward from 1.8.2, introduced an array of bools called gapsToRecheck, which are now a single bit in array of nybble flags in this version for(int i = 0; i < 8 * 16; i++ ) { - columnFlags[i] = 0; + columnFlags[i] = 0; } // 4J added - to flag if any emissive tile has been added to this chunk (will be cleared when lighting has been successfully completed for this chunk). Defaulting to true @@ -183,7 +183,7 @@ LevelChunk::LevelChunk(Level *level, byteArray blocks, int x, int z) : ENTITY_BL // skyLight = new DataLayer(blocks.length, level->depthBits); // blockLight = new DataLayer(blocks.length, level->depthBits); - if(Level::maxBuildHeight > Level::COMPRESSED_CHUNK_SECTION_HEIGHT) + if(Level::maxBuildHeight > Level::COMPRESSED_CHUNK_SECTION_HEIGHT) { if(blocks.length > Level::COMPRESSED_CHUNK_SECTION_TILES) upperBlocks = new CompressedTileStorage(blocks,Level::COMPRESSED_CHUNK_SECTION_TILES); else upperBlocks = new CompressedTileStorage(true); @@ -388,7 +388,7 @@ void LevelChunk::startSharingTilesAndData(int forceMs) else { // Only force if it has been more than forceMs milliseconds since we last wanted to unshare this chunk - __int64 timenow = System::currentTimeMillis(); + int64_t timenow = System::currentTimeMillis(); if( ( timenow - lastUnsharedTime ) < forceMs ) { LeaveCriticalSection(&m_csSharing); @@ -551,7 +551,7 @@ void LevelChunk::recalcHeightmap() { int y = Level::maxBuildHeight - 1; // int p = x << level->depthBitsPlusFour | z << level->depthBits; // 4J - removed - + #ifdef __PSVITA__ int Index = ( x << 11 ) + ( z << 7 ); int offset = Level::COMPRESSED_CHUNK_SECTION_TILES; @@ -656,7 +656,7 @@ void LevelChunk::recalcHeightmap() void LevelChunk::lightLava() { if( !emissiveAdded ) return; - + for (int x = 0; x < 16; x++) for (int z = 0; z < 16; z++) { @@ -697,7 +697,7 @@ void LevelChunk::recheckGaps(bool bForce) // 4J added - otherwise we can end up doing a very broken kind of lighting since for an empty chunk, the heightmap is all zero, but it // still has an x and z of 0 which means that the level->getHeightmap references in here find a real chunk near the origin, and then attempt // to light massive gaps between the height of 0 and whatever heights are in those. - if( isEmpty() ) return; + if( isEmpty() ) return; // 4J added int minXZ = - (level->dimension->getXZSize() * 16 ) / 2; @@ -765,7 +765,7 @@ void LevelChunk::lightGap(int x, int z, int source) { lightGap(x, z, source, height + 1); } - else if (height < source) + else if (height < source) { lightGap(x, z, height, source + 1); } @@ -793,7 +793,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) if (yStart > yOld) y = yStart; // int p = x << level->depthBitsPlusFour | z << level->depthBits; // 4J - removed - + CompressedTileStorage *blocks = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT?upperBlocks : lowerBlocks; while (y > 0 && Tile::lightBlock[blocks->get(x,(y-1) % Level::COMPRESSED_CHUNK_SECTION_HEIGHT,z) & 0xff] == 0) // 4J - blocks->get() was blocks[p + y - 1] { @@ -845,7 +845,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) } int br = 15; - + SparseLightStorage *skyLight = y >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT? upperSkyLight : lowerSkyLight; while (y > 0 && br > 0) { @@ -891,7 +891,7 @@ void LevelChunk::recalcHeight(int x, int yStart, int z) /** * The purpose of this method is to allow the EmptyLevelChunk to be all air * but still block light. See EmptyLevelChunk.java -* +* * @param x * @param y * @param z @@ -921,7 +921,7 @@ bool LevelChunk::setTileAndData(int x, int y, int z, int _tile, int _data) } int oldHeight = heightmap[slot] & 0xff; - + CompressedTileStorage *blocks = y >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperBlocks : lowerBlocks; SparseDataStorage *data = y >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperData : lowerData; int old = blocks->get(x,y % Level::COMPRESSED_CHUNK_SECTION_HEIGHT,z); @@ -1116,12 +1116,12 @@ void LevelChunk::getNeighbourBrightnesses(int *brightnesses, LightLayer::variety brightnesses[5] = light->get(x, y % Level::COMPRESSED_CHUNK_SECTION_HEIGHT, z + 1); } - + if( layer == LightLayer::Sky ) light = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperSkyLight : lowerSkyLight; else light = (y-1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperBlockLight : lowerBlockLight; if(light) brightnesses[2] = light->get(x, (y - 1) % Level::COMPRESSED_CHUNK_SECTION_HEIGHT, z); - + if( layer == LightLayer::Sky ) light = (y+1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperSkyLight : lowerSkyLight; else light = (y+1) >= Level::COMPRESSED_CHUNK_SECTION_HEIGHT ? upperBlockLight : lowerBlockLight; if(light) brightnesses[3] = light->get(x, (y + 1) % Level::COMPRESSED_CHUNK_SECTION_HEIGHT, z); @@ -1227,7 +1227,7 @@ void LevelChunk::removeEntity(shared_ptr e, int yc) // MGH - have to sort this C++11 code static bool bShowMsg = true; if(bShowMsg) - { + { app.DebugPrintf("Need to add C++11 shrink_to_fit for PS3\n"); bShowMsg = false; } @@ -1282,7 +1282,7 @@ shared_ptr LevelChunk::getTileEntity(int x, int y, int z) int t = getTile(x, y, z); if (t <= 0 || !Tile::tiles[t]->isEntityTile()) return nullptr; - + // 4J-PB changed from this in 1.7.3 //EntityTile *et = (EntityTile *) Tile::tiles[t]; //et->onPlace(level, this->x * 16 + x, y, this->z * 16 + z); @@ -1316,7 +1316,7 @@ shared_ptr LevelChunk::getTileEntity(int x, int y, int z) LeaveCriticalSection(&m_csTileEntities); return nullptr; } - + return tileEntity; } @@ -1631,7 +1631,7 @@ void LevelChunk::getEntitiesOfClass(const type_info& ec, AABB *bb, vector > *entities = entityBlocks[yc]; - + AUTO_VAR(itEnd, entities->end()); for (AUTO_VAR(it, entities->begin()); it != itEnd; it++) { @@ -1879,7 +1879,7 @@ void LevelChunk::setCheckAllLight() checkLightPosition = 0; } -Random *LevelChunk::getRandom(__int64 l) +Random *LevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } @@ -2130,7 +2130,7 @@ void LevelChunk::setSkyLightDataAllBright() void LevelChunk::compressLighting() { // The lighting data is now generally not shared between host & local client, but is for a while at the start of level creation (until the point where the chunk data would be transferred by network - // data for remote clients). We'll therefore either be compressing a shared copy here or one of the server or client copies depending on + // data for remote clients). We'll therefore either be compressing a shared copy here or one of the server or client copies depending on lowerSkyLight->compress(); upperSkyLight->compress(); lowerBlockLight->compress(); @@ -2400,7 +2400,7 @@ void LevelChunk::reorderBlocksAndDataToXZY(int y0, int xs, int ys, int zs, byteA int y1 = y0 + ys; unsigned int tileCount = xs * ys * zs; unsigned int halfTileCount = tileCount/2; - + int sectionHeight = Level::COMPRESSED_CHUNK_SECTION_HEIGHT; int lowerYSpan = min(y1, sectionHeight) - y0; int upperYSpan = ys - lowerYSpan; @@ -2439,7 +2439,7 @@ void LevelChunk::reorderBlocksAndDataToXZY(int y0, int xs, int ys, int zs, byteA //setBlocksAndData(*data, x0, y0, z0, x1, y1, z1, p); //// If it is a full chunk, we'll need to rearrange into the order the rest of the game expects - //if( xs == 16 && ys == 128 && zs == 16 && ( ( x & 15 ) == 0 ) && ( y == 0 ) && ( ( z & 15 ) == 0 ) ) + //if( xs == 16 && ys == 128 && zs == 16 && ( ( x & 15 ) == 0 ) && ( y == 0 ) && ( ( z & 15 ) == 0 ) ) //{ // byteArray newBuffer = byteArray(81920); // for( int x = 0; x < 16; x++ ) diff --git a/Minecraft.World/LevelChunk.h b/Minecraft.World/LevelChunk.h index e9510ad5..820835c3 100644 --- a/Minecraft.World/LevelChunk.h +++ b/Minecraft.World/LevelChunk.h @@ -102,13 +102,13 @@ public: unordered_map, TilePosKeyHash, TilePosKeyEq> tileEntities; vector > **entityBlocks; - + static const int sTerrainPopulatedFromHere = 2; static const int sTerrainPopulatedFromW = 4; static const int sTerrainPopulatedFromS = 8; static const int sTerrainPopulatedFromSW = 16; static const int sTerrainPopulatedAllAffecting = 30; // All the post-processing that can actually place tiles in this chunk are complete - static const int sTerrainPopulatedFromNW = 32; + static const int sTerrainPopulatedFromNW = 32; static const int sTerrainPopulatedFromN = 64; static const int sTerrainPopulatedFromNE = 128; static const int sTerrainPopulatedFromE = 256; @@ -134,8 +134,8 @@ public: void stopSharingTilesAndData(); // 4J added virtual void reSyncLighting(); // 4J added void startSharingTilesAndData(int forceMs = 0); // 4J added - __int64 lastUnsharedTime; // 4J added - __int64 lastSaveTime; + int64_t lastUnsharedTime; // 4J added + int64_t lastSaveTime; bool seenByPlayer; #ifdef _LARGE_WORLDS @@ -213,7 +213,7 @@ public: virtual bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); // 4J added virtual void setCheckAllLight(); - virtual Random *getRandom(__int64 l); + virtual Random *getRandom(int64_t l); virtual bool isEmpty(); virtual void attemptCompression(); @@ -238,9 +238,9 @@ public: byteArray getBiomes(); void setBiomes(byteArray biomes); bool biomeHasRain(int x, int z); // 4J added - bool biomeHasSnow(int x, int z); // 4J added + bool biomeHasSnow(int x, int z); // 4J added private: - void updateBiomeFlags(int x, int z); // 4J added + void updateBiomeFlags(int x, int z); // 4J added public: void compressLighting(); // 4J added void compressBlocks(); // 4J added diff --git a/Minecraft.World/LevelData.cpp b/Minecraft.World/LevelData.cpp index 026dca70..486fbe98 100644 --- a/Minecraft.World/LevelData.cpp +++ b/Minecraft.World/LevelData.cpp @@ -14,18 +14,18 @@ LevelData::LevelData(CompoundTag *tag) { seed = tag->getLong(L"RandomSeed"); m_pGenerator = LevelType::lvl_normal; - if (tag->contains(L"generatorName")) + if (tag->contains(L"generatorName")) { wstring generatorName = tag->getString(L"generatorName"); m_pGenerator = LevelType::getLevelType(generatorName); - if (m_pGenerator == NULL) + if (m_pGenerator == NULL) { m_pGenerator = LevelType::lvl_normal; - } - else if (m_pGenerator->hasReplacement()) + } + else if (m_pGenerator->hasReplacement()) { int generatorVersion = 0; - if (tag->contains(L"generatorVersion")) + if (tag->contains(L"generatorVersion")) { generatorVersion = tag->getInt(L"generatorVersion"); } @@ -80,7 +80,7 @@ LevelData::LevelData(CompoundTag *tag) hasBeenInCreative = tag->getBoolean(L"hasBeenInCreative"); // 4J added so we can not award achievements to levels modified in creative // 4J added - for stronghold position - bStronghold = tag->getBoolean(L"hasStronghold"); + bStronghold = tag->getBoolean(L"hasStronghold"); if(bStronghold==false) { @@ -95,7 +95,7 @@ LevelData::LevelData(CompoundTag *tag) } // 4J added - for stronghold end portal position - bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal"); + bStrongholdEndPortal = tag->getBoolean(L"hasStrongholdEndPortal"); if(bStrongholdEndPortal==false) { @@ -111,7 +111,7 @@ LevelData::LevelData(CompoundTag *tag) // 4J Added m_xzSize = tag->getInt(L"XZSize"); m_hellScale = tag->getInt(L"HellScale"); - + m_xzSize = min(m_xzSize,LEVEL_MAX_WIDTH); m_xzSize = max(m_xzSize,LEVEL_MIN_WIDTH); @@ -126,20 +126,20 @@ LevelData::LevelData(CompoundTag *tag) } /* 4J - we don't store this anymore - if (tag->contains(L"Player")) + if (tag->contains(L"Player")) { loadedPlayerTag = tag->getCompound(L"Player"); dimension = loadedPlayerTag->getInt(L"Dimension"); } else - { + { this->loadedPlayerTag = NULL; } */ dimension = 0; } -LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) +LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) { this->seed = levelSettings->getSeed(); this->gameType = levelSettings->getGameType(); @@ -149,7 +149,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) this->m_pGenerator = levelSettings->getLevelType(); this->hardcore = levelSettings->isHardcore(); - // 4J Stu - Default initers + // 4J Stu - Default initers this->xSpawn = 0; this->ySpawn = 0; this->zSpawn = 0; @@ -179,7 +179,7 @@ LevelData::LevelData(LevelSettings *levelSettings, const wstring& levelName) this->bStrongholdEndPortal = false; m_xzSize = levelSettings->getXZSize(); m_hellScale = levelSettings->getHellScale(); - + m_xzSize = min(m_xzSize,LEVEL_MAX_WIDTH); m_xzSize = max(m_xzSize,LEVEL_MIN_WIDTH); @@ -243,13 +243,13 @@ CompoundTag *LevelData::createTag() return tag; } -CompoundTag *LevelData::createTag(vector > *players) +CompoundTag *LevelData::createTag(vector > *players) { // 4J - removed all code for storing tags for players return createTag(); } -void LevelData::setTagData(CompoundTag *tag) +void LevelData::setTagData(CompoundTag *tag) { tag->putLong(L"RandomSeed", seed); tag->putString(L"generatorName", m_pGenerator->getGeneratorName()); @@ -287,17 +287,17 @@ void LevelData::setTagData(CompoundTag *tag) tag->putInt(L"HellScale", m_hellScale); } -__int64 LevelData::getSeed() +int64_t LevelData::getSeed() { return seed; } -int LevelData::getXSpawn() +int LevelData::getXSpawn() { return xSpawn; } -int LevelData::getYSpawn() +int LevelData::getYSpawn() { return ySpawn; } @@ -307,7 +307,7 @@ int LevelData::getZSpawn() return zSpawn; } -int LevelData::getXStronghold() +int LevelData::getXStronghold() { return xStronghold; } @@ -318,7 +318,7 @@ int LevelData::getZStronghold() return zStronghold; } -int LevelData::getXStrongholdEndPortal() +int LevelData::getXStrongholdEndPortal() { return xStrongholdEndPortal; } @@ -329,12 +329,12 @@ int LevelData::getZStrongholdEndPortal() return zStrongholdEndPortal; } -__int64 LevelData::getTime() +int64_t LevelData::getTime() { return time; } -__int64 LevelData::getSizeOnDisk() +int64_t LevelData::getSizeOnDisk() { return sizeOnDisk; } @@ -350,7 +350,7 @@ CompoundTag *LevelData::getLoadedPlayerTag() // return dimension; //} -void LevelData::setSeed(__int64 seed) +void LevelData::setSeed(int64_t seed) { this->seed = seed; } @@ -360,7 +360,7 @@ void LevelData::setXSpawn(int xSpawn) this->xSpawn = xSpawn; } -void LevelData::setYSpawn(int ySpawn) +void LevelData::setYSpawn(int ySpawn) { this->ySpawn = ySpawn; } @@ -411,12 +411,12 @@ void LevelData::setZStrongholdEndPortal(int zStrongholdEndPortal) this->zStrongholdEndPortal = zStrongholdEndPortal; } -void LevelData::setTime(__int64 time) +void LevelData::setTime(int64_t time) { this->time = time; } -void LevelData::setSizeOnDisk(__int64 sizeOnDisk) +void LevelData::setSizeOnDisk(int64_t sizeOnDisk) { this->sizeOnDisk = sizeOnDisk; } @@ -428,7 +428,7 @@ void LevelData::setLoadedPlayerTag(CompoundTag *loadedPlayerTag) } // 4J Remove TU9 as it's never used -//void LevelData::setDimension(int dimension) +//void LevelData::setDimension(int dimension) //{ // this->dimension = dimension; //} @@ -440,7 +440,7 @@ void LevelData::setSpawn(int xSpawn, int ySpawn, int zSpawn) this->zSpawn = zSpawn; } -wstring LevelData::getLevelName() +wstring LevelData::getLevelName() { return levelName; } @@ -450,7 +450,7 @@ void LevelData::setLevelName(const wstring& levelName) this->levelName = levelName; } -int LevelData::getVersion() +int LevelData::getVersion() { return version; } @@ -460,7 +460,7 @@ void LevelData::setVersion(int version) this->version = version; } -__int64 LevelData::getLastPlayed() +int64_t LevelData::getLastPlayed() { return lastPlayed; } @@ -485,7 +485,7 @@ void LevelData::setThunderTime(int thunderTime) this->thunderTime = thunderTime; } -bool LevelData::isRaining() +bool LevelData::isRaining() { return raining; } @@ -543,12 +543,12 @@ void LevelData::setHasBeenInCreative(bool value) hasBeenInCreative = value; } -LevelType *LevelData::getGenerator() +LevelType *LevelData::getGenerator() { return m_pGenerator; } -void LevelData::setGenerator(LevelType *generator) +void LevelData::setGenerator(LevelType *generator) { m_pGenerator = generator; } diff --git a/Minecraft.World/LevelData.h b/Minecraft.World/LevelData.h index 0afe9be2..405ba1b8 100644 --- a/Minecraft.World/LevelData.h +++ b/Minecraft.World/LevelData.h @@ -11,14 +11,14 @@ class LevelData { friend class DerivedLevelData; private: - __int64 seed; + int64_t seed; LevelType *m_pGenerator;// = LevelType.normal; int xSpawn; int ySpawn; int zSpawn; - __int64 time; - __int64 lastPlayed; - __int64 sizeOnDisk; + int64_t time; + int64_t lastPlayed; + int64_t sizeOnDisk; // CompoundTag *loadedPlayerTag; // 4J removed int dimension; wstring levelName; @@ -71,7 +71,7 @@ protected: virtual void setTagData(CompoundTag *tag); // 4J - removed CompoundTag *playerTag public: - virtual __int64 getSeed(); + virtual int64_t getSeed(); virtual int getXSpawn(); virtual int getYSpawn(); virtual int getZSpawn(); @@ -79,11 +79,11 @@ public: virtual int getZStronghold(); virtual int getXStrongholdEndPortal(); virtual int getZStrongholdEndPortal(); - virtual __int64 getTime(); - virtual __int64 getSizeOnDisk(); + virtual int64_t getTime(); + virtual int64_t getSizeOnDisk(); virtual CompoundTag *getLoadedPlayerTag(); //int getDimension(); // 4J Removed TU 9 as it's never accurate - virtual void setSeed(__int64 seed); + virtual void setSeed(int64_t seed); virtual void setXSpawn(int xSpawn); virtual void setYSpawn(int ySpawn); virtual void setZSpawn(int zSpawn); @@ -96,8 +96,8 @@ public: virtual void setXStrongholdEndPortal(int xStrongholdEndPortal); virtual void setZStrongholdEndPortal(int zStrongholdEndPortal); - virtual void setTime(__int64 time); - virtual void setSizeOnDisk(__int64 sizeOnDisk); + virtual void setTime(int64_t time); + virtual void setSizeOnDisk(int64_t sizeOnDisk); virtual void setLoadedPlayerTag(CompoundTag *loadedPlayerTag); //void setDimension(int dimension); // 4J Removed TU 9 as it's never used virtual void setSpawn(int xSpawn, int ySpawn, int zSpawn); @@ -105,7 +105,7 @@ public: virtual void setLevelName(const wstring& levelName); virtual int getVersion(); virtual void setVersion(int version); - virtual __int64 getLastPlayed(); + virtual int64_t getLastPlayed(); virtual bool isThundering(); virtual void setThundering(bool thundering); virtual int getThunderTime(); diff --git a/Minecraft.World/LevelSettings.cpp b/Minecraft.World/LevelSettings.cpp index 59faa1ca..1af62626 100644 --- a/Minecraft.World/LevelSettings.cpp +++ b/Minecraft.World/LevelSettings.cpp @@ -85,7 +85,7 @@ GameType *GameType::byName(const wstring &name) return SURVIVAL; } -void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) +void LevelSettings::_init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) { this->seed = seed; this->gameType = gameType; @@ -99,11 +99,11 @@ void LevelSettings::_init(__int64 seed, GameType *gameType, bool generateMapFeat m_hellScale = hellScale; } -LevelSettings::LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : - seed(seed), - gameType(gameType), +LevelSettings::LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale) : + seed(seed), + gameType(gameType), hardcore(hardcore), - generateMapFeatures(generateMapFeatures), + generateMapFeatures(generateMapFeatures), newSeaLevel(newSeaLevel), levelType(levelType), startingBonusItems(false) @@ -133,7 +133,7 @@ bool LevelSettings::hasStartingBonusItems() return startingBonusItems; } -__int64 LevelSettings::getSeed() +int64_t LevelSettings::getSeed() { return seed; } @@ -148,7 +148,7 @@ bool LevelSettings::isHardcore() return hardcore; } -LevelType *LevelSettings::getLevelType() +LevelType *LevelSettings::getLevelType() { return levelType; } diff --git a/Minecraft.World/LevelSettings.h b/Minecraft.World/LevelSettings.h index c183df8c..2de2330a 100644 --- a/Minecraft.World/LevelSettings.h +++ b/Minecraft.World/LevelSettings.h @@ -35,7 +35,7 @@ public: class LevelSettings { private: - __int64 seed; + int64_t seed; GameType *gameType; bool generateMapFeatures; bool hardcore; @@ -46,15 +46,15 @@ private: int m_xzSize; // 4J Added int m_hellScale; - void _init(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + void _init(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param public: - LevelSettings(__int64 seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param + LevelSettings(int64_t seed, GameType *gameType, bool generateMapFeatures, bool hardcore, bool newSeaLevel, LevelType *levelType, int xzSize, int hellScale); // 4J Added xzSize and hellScale param LevelSettings(LevelData *levelData); LevelSettings *enableStartingBonusItems(); // 4J - brought forward from 1.3.2 LevelSettings *enableSinglePlayerCommands(); bool hasStartingBonusItems(); // 4J - brought forward from 1.3.2 - __int64 getSeed(); + int64_t getSeed(); GameType *getGameType(); bool isHardcore(); LevelType *getLevelType(); diff --git a/Minecraft.World/LevelSummary.cpp b/Minecraft.World/LevelSummary.cpp index d8e7ddee..915abaf6 100644 --- a/Minecraft.World/LevelSummary.cpp +++ b/Minecraft.World/LevelSummary.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "LevelSummary.h" -LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : +LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats) : levelId( levelId ), levelName( levelName ), lastPlayed( lastPlayed ), @@ -13,7 +13,7 @@ LevelSummary::LevelSummary(const wstring& levelId, const wstring& levelName, __i { } -wstring LevelSummary::getLevelId() +wstring LevelSummary::getLevelId() { return levelId; } @@ -23,28 +23,28 @@ wstring LevelSummary::getLevelName() return levelName; } -__int64 LevelSummary::getSizeOnDisk() +int64_t LevelSummary::getSizeOnDisk() { return sizeOnDisk; } -bool LevelSummary::isRequiresConversion() +bool LevelSummary::isRequiresConversion() { return requiresConversion; } -__int64 LevelSummary::getLastPlayed() +int64_t LevelSummary::getLastPlayed() { return lastPlayed; } -int LevelSummary::compareTo(LevelSummary *rhs) +int LevelSummary::compareTo(LevelSummary *rhs) { if (lastPlayed < rhs->lastPlayed) { return 1; } - if (lastPlayed > rhs->lastPlayed) + if (lastPlayed > rhs->lastPlayed) { return -1; } diff --git a/Minecraft.World/LevelSummary.h b/Minecraft.World/LevelSummary.h index bbf391ff..ce5699a2 100644 --- a/Minecraft.World/LevelSummary.h +++ b/Minecraft.World/LevelSummary.h @@ -7,20 +7,20 @@ class LevelSummary { const wstring levelId; const wstring levelName; - const __int64 lastPlayed; - const __int64 sizeOnDisk; + const int64_t lastPlayed; + const int64_t sizeOnDisk; const bool requiresConversion; GameType *gameMode; const bool hardcore; const bool _hasCheats; public: - LevelSummary(const wstring& levelId, const wstring& levelName, __int64 lastPlayed, __int64 sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); + LevelSummary(const wstring& levelId, const wstring& levelName, int64_t lastPlayed, int64_t sizeOnDisk, GameType *gameMode, bool requiresConversion, bool hardcore, bool hasCheats); wstring getLevelId(); wstring getLevelName(); - __int64 getSizeOnDisk(); + int64_t getSizeOnDisk(); bool isRequiresConversion(); - __int64 getLastPlayed(); + int64_t getLastPlayed(); int compareTo(LevelSummary *rhs); GameType *getGameMode(); bool isHardcore(); diff --git a/Minecraft.World/LightningBolt.h b/Minecraft.World/LightningBolt.h index 28d5e004..2a14e88a 100644 --- a/Minecraft.World/LightningBolt.h +++ b/Minecraft.World/LightningBolt.h @@ -16,7 +16,7 @@ private: int life; public: - __int64 seed; + int64_t seed; private: int flashes; diff --git a/Minecraft.World/LoginPacket.cpp b/Minecraft.World/LoginPacket.cpp index bfe69226..44ed62b3 100644 --- a/Minecraft.World/LoginPacket.cpp +++ b/Minecraft.World/LoginPacket.cpp @@ -66,7 +66,7 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, PlayerUID o } // Server -> Client -LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) +LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale) { this->userName = userName; this->clientVersion = clientVersion; @@ -94,13 +94,13 @@ LoginPacket::LoginPacket(const wstring& userName, int clientVersion, LevelType * m_hellScale = hellScale; } -void LoginPacket::read(DataInputStream *dis) //throws IOException +void LoginPacket::read(DataInputStream *dis) //throws IOException { clientVersion = dis->readInt(); userName = readUtf(dis, Player::MAX_NAME_LENGTH); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -131,15 +131,15 @@ void LoginPacket::read(DataInputStream *dis) //throws IOException } -void LoginPacket::write(DataOutputStream *dos) //throws IOException +void LoginPacket::write(DataOutputStream *dos) //throws IOException { dos->writeInt(clientVersion); writeUtf(userName, dos); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -171,13 +171,13 @@ void LoginPacket::handle(PacketListener *listener) listener->handleLogin(shared_from_this()); } -int LoginPacket::getEstimatedSize() +int LoginPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != NULL) { length = (int)m_pLevelType->getGeneratorName().length(); } - return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(__int64) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); + return (int)(sizeof(int) + userName.length() + 4 + 6 + sizeof(int64_t) + sizeof(char) + sizeof(int) + (2*sizeof(PlayerUID)) +1 + sizeof(char) + sizeof(BYTE) + sizeof(bool) + sizeof(bool) + length + sizeof(unsigned int)); } diff --git a/Minecraft.World/LoginPacket.h b/Minecraft.World/LoginPacket.h index 09041135..bf7164fa 100644 --- a/Minecraft.World/LoginPacket.h +++ b/Minecraft.World/LoginPacket.h @@ -9,10 +9,10 @@ class LoginPacket : public Packet, public enable_shared_from_this public: int clientVersion; wstring userName; - __int64 seed; + int64_t seed; char dimension; PlayerUID m_offlineXuid, m_onlineXuid; // 4J Added - char difficulty; // 4J Added + char difficulty; // 4J Added bool m_friendsOnlyUGC; // 4J Added DWORD m_ugcPlayersVersion; // 4J Added INT m_multiplayerInstanceId; //4J Added for sentient @@ -31,7 +31,7 @@ public: BYTE maxPlayers; LoginPacket(); - LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, __int64 seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client + LoginPacket(const wstring& userName, int clientVersion, LevelType *pLevelType, int64_t seed, int gameType, char dimension, BYTE mapHeight, BYTE maxPlayers, char difficulty, INT m_multiplayerInstanceId, BYTE playerIndex, bool newSeaLevel, unsigned int uiGamePrivileges, int xzSize, int hellScale); // Server -> Client LoginPacket(const wstring& userName, int clientVersion, PlayerUID offlineXuid, PlayerUID onlineXuid, bool friendsOnlyUGC, DWORD ugcPlayersVersion, DWORD skinId, DWORD capeId, bool isGuest); // Client -> Server virtual void read(DataInputStream *dis); diff --git a/Minecraft.World/LongTag.h b/Minecraft.World/LongTag.h index 2dcd3819..b957ec6d 100644 --- a/Minecraft.World/LongTag.h +++ b/Minecraft.World/LongTag.h @@ -4,10 +4,10 @@ class LongTag : public Tag { public: - __int64 data; + int64_t data; LongTag(const wstring &name) : Tag(name) {} - LongTag(const wstring &name, __int64 data) : Tag(name) {this->data = data; } - + LongTag(const wstring &name, int64_t data) : Tag(name) {this->data = data; } + void write(DataOutput *dos) { dos->writeLong(data); } void load(DataInput *dis) { data = dis->readLong(); } diff --git a/Minecraft.World/McRegionChunkStorage.cpp b/Minecraft.World/McRegionChunkStorage.cpp index a11cb1c1..8075bc80 100644 --- a/Minecraft.World/McRegionChunkStorage.cpp +++ b/Minecraft.World/McRegionChunkStorage.cpp @@ -32,7 +32,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr m_saveFile->createFile(ConsoleSavePath(L"r.-1.0.mcr")); } - + #ifdef SPLIT_SAVES ConsoleSavePath currentFile = ConsoleSavePath( m_prefix + wstring( L"entities.dat" ) ); @@ -45,7 +45,7 @@ McRegionChunkStorage::McRegionChunkStorage(ConsoleSaveFile *saveFile, const wstr for(int i = 0; i < count; ++i) { - __int64 index = dis.readLong(); + int64_t index = dis.readLong(); CompoundTag *tag = NbtIo::read(&dis); ByteArrayOutputStream bos; @@ -78,7 +78,7 @@ LevelChunk *McRegionChunkStorage::load(Level *level, int x, int z) // If we can't find the chunk in the save file, then we should remove any entities we might have for that chunk if(regionChunkInputStream == NULL) { - __int64 index = ((__int64)(x) << 32) | (((__int64)(z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(x) << 32) | (((int64_t)(z))&0x00000000FFFFFFFF); AUTO_VAR(it, m_entityData.find(index)); if(it != m_entityData.end()) @@ -235,7 +235,7 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES PIXBeginNamedEvent(0,"Saving entities"); - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); delete m_entityData[index].data; @@ -269,8 +269,8 @@ void McRegionChunkStorage::saveEntities(Level *level, LevelChunk *levelChunk) void McRegionChunkStorage::loadEntities(Level *level, LevelChunk *levelChunk) { #ifdef SPLIT_SAVES - __int64 index = ((__int64)(levelChunk->x) << 32) | (((__int64)(levelChunk->z))&0x00000000FFFFFFFF); - + int64_t index = ((int64_t)(levelChunk->x) << 32) | (((int64_t)(levelChunk->z))&0x00000000FFFFFFFF); + AUTO_VAR(it, m_entityData.find(index)); if(it != m_entityData.end()) { diff --git a/Minecraft.World/McRegionChunkStorage.h b/Minecraft.World/McRegionChunkStorage.h index 50dabd52..47ae1c99 100644 --- a/Minecraft.World/McRegionChunkStorage.h +++ b/Minecraft.World/McRegionChunkStorage.h @@ -16,7 +16,7 @@ private: ConsoleSaveFile *m_saveFile; static CRITICAL_SECTION cs_memory; - unordered_map<__int64, byteArray> m_entityData; + unordered_map m_entityData; static std::deque s_chunkDataQueue; static int s_runningThreadCount; diff --git a/Minecraft.World/Mth.cpp b/Minecraft.World/Mth.cpp index eccd828e..3b5412ad 100644 --- a/Minecraft.World/Mth.cpp +++ b/Minecraft.World/Mth.cpp @@ -50,9 +50,9 @@ int Mth::floor(float v) return v < i ? i - 1 : i; } -__int64 Mth::lfloor(double v) +int64_t Mth::lfloor(double v) { - __int64 i = (__int64) v; + int64_t i = (int64_t) v; return v < i ? i - 1 : i; } diff --git a/Minecraft.World/Mth.h b/Minecraft.World/Mth.h index 17119fb1..78c3ef10 100644 --- a/Minecraft.World/Mth.h +++ b/Minecraft.World/Mth.h @@ -22,7 +22,7 @@ public : static float sqrt(float x); static float sqrt(double x); static int floor(float v); - static __int64 lfloor(double v); + static int64_t lfloor(double v); static int fastFloor(double x); static int floor(double v); static int absFloor(double v); diff --git a/Minecraft.World/NbtSlotFile.cpp b/Minecraft.World/NbtSlotFile.cpp index 81880cfb..0d679897 100644 --- a/Minecraft.World/NbtSlotFile.cpp +++ b/Minecraft.World/NbtSlotFile.cpp @@ -4,7 +4,7 @@ byteArray NbtSlotFile::READ_BUFFER(1024*1024); -__int64 NbtSlotFile::largest = 0; +int64_t NbtSlotFile::largest = 0; NbtSlotFile::NbtSlotFile(File file) { @@ -144,12 +144,12 @@ int NbtSlotFile::getFreeSlot() // fileSlot = toReplace->back(); // toReplace->pop_back(); // } else - + if (freeFileSlots.size() > 0) { fileSlot = freeFileSlots.back(); freeFileSlots.pop_back(); - } + } else { fileSlot = totalFileSlots++; @@ -164,7 +164,7 @@ void NbtSlotFile::replaceSlot(int slot, vector *tags) DWORD numberOfBytesWritten; toReplace = fileSlotMap[slot]; fileSlotMap[slot] = new vector(); - + AUTO_VAR(itEndTags, tags->end()); for (AUTO_VAR(it, tags->begin()); it != itEndTags; it++) { @@ -227,7 +227,7 @@ void NbtSlotFile::replaceSlot(int slot, vector *tags) } delete[] compressed.data; } - + AUTO_VAR(itEndToRep, toReplace->end()); for (AUTO_VAR(it, toReplace->begin()); it != itEndToRep; it++) { diff --git a/Minecraft.World/NbtSlotFile.h b/Minecraft.World/NbtSlotFile.h index 93b4fe57..c717c657 100644 --- a/Minecraft.World/NbtSlotFile.h +++ b/Minecraft.World/NbtSlotFile.h @@ -19,7 +19,7 @@ private: int fileSlotMapLength; vector freeFileSlots; int totalFileSlots; - static __int64 largest; + static int64_t largest; public: NbtSlotFile(File file); diff --git a/Minecraft.World/NotGateTile.cpp b/Minecraft.World/NotGateTile.cpp index a3971284..d9fc35a7 100644 --- a/Minecraft.World/NotGateTile.cpp +++ b/Minecraft.World/NotGateTile.cpp @@ -121,7 +121,7 @@ void NotGateTile::tick(Level *level, int x, int y, int z, Random *random) } } - if (on) + if (on) { if (neighborSignal) { @@ -152,7 +152,7 @@ void NotGateTile::tick(Level *level, int x, int y, int z, Random *random) level->setTileAndData(x, y, z, Tile::notGate_on_Id, level->getData(x, y, z)); } else - { + { app.DebugPrintf("Torch at (%d,%d,%d) has toggled too many times\n",x,y,z); } } @@ -221,7 +221,7 @@ int NotGateTile::cloneTileId(Level *level, int x, int y, int z) return Tile::notGate_on_Id; } -void NotGateTile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) +void NotGateTile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { deque *toggles = recentToggles[level]; diff --git a/Minecraft.World/NotGateTile.h b/Minecraft.World/NotGateTile.h index 52dd4a2e..ea0aac1e 100644 --- a/Minecraft.World/NotGateTile.h +++ b/Minecraft.World/NotGateTile.h @@ -19,9 +19,9 @@ public: { public: int x, y, z; - __int64 when; + int64_t when; - Toggle(int x, int y, int z, __int64 when) + Toggle(int x, int y, int z, int64_t when) { this->x = x; this->y = y; @@ -61,7 +61,7 @@ public: public: void animateTick(Level *level, int xt, int yt, int zt, Random *random); int cloneTileId(Level *level, int x, int y, int z); - void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); void registerIcons(IconRegister *iconRegister); }; \ No newline at end of file diff --git a/Minecraft.World/OldChunkStorage.cpp b/Minecraft.World/OldChunkStorage.cpp index 50c29a96..c1515c12 100644 --- a/Minecraft.World/OldChunkStorage.cpp +++ b/Minecraft.World/OldChunkStorage.cpp @@ -103,7 +103,7 @@ File OldChunkStorage::getFile(int x, int z) file = File( file, wstring( name ) ); if ( !file.exists() ) { - if (!create) + if (!create) { return File(L""); } @@ -163,7 +163,7 @@ void OldChunkStorage::save(Level *level, LevelChunk *levelChunk) { LevelData *levelData = level->getLevelData(); levelData->setSizeOnDisk( levelData->getSizeOnDisk() - file.length() ); - } + } // 4J - removed try/catch // try { @@ -202,7 +202,7 @@ bool OldChunkStorage::saveEntities(LevelChunk *lc, Level *level, CompoundTag *ta lc->lastSaveHadEntities = false; ListTag *entityTags = new ListTag(); - + #ifdef _ENTITIES_RW_SECTION EnterCriticalRWSection(&lc->m_csEntities, true); #else @@ -263,7 +263,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos) #ifndef SPLIT_SAVES saveEntities(lc, level, tag); #endif - + PIXBeginNamedEvent(0,"Saving tile entities"); ListTag *tileEntityTags = new ListTag(); @@ -283,7 +283,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, DataOutputStream *dos) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) @@ -372,7 +372,7 @@ void OldChunkStorage::save(LevelChunk *lc, Level *level, CompoundTag *tag) vector *ticksInChunk = level->fetchTicksInChunk(lc, false); if (ticksInChunk != NULL) { - __int64 levelTime = level->getTime(); + int64_t levelTime = level->getTime(); ListTag *tickTags = new ListTag(); for( int i = 0; i < ticksInChunk->size(); i++ ) @@ -442,7 +442,7 @@ LevelChunk *OldChunkStorage::load(Level *level, DataInputStream *dis) dis->readFully(levelChunk->heightmap); - levelChunk->terrainPopulated = dis->readShort(); + levelChunk->terrainPopulated = dis->readShort(); // If all neighbours have been post-processed, then we should have done the post-post-processing now. Check that this is set as if it isn't then we won't be able // to send network data for chunks, and we won't ever try and set it again as all the directional flags are now already set - should only be an issue for old maps // before this flag was added. @@ -512,13 +512,13 @@ LevelChunk *OldChunkStorage::load(Level *level, CompoundTag *tag) if( tag->get(L"TerrainPopulated") ) { // Java bool type or byte bitfield - levelChunk->terrainPopulated = tag->getByte(L"TerrainPopulated"); + levelChunk->terrainPopulated = tag->getByte(L"TerrainPopulated"); if( levelChunk->terrainPopulated >= 1 ) levelChunk->terrainPopulated = LevelChunk::sTerrainPopulatedAllNeighbours | LevelChunk::sTerrainPostPostProcessed; // Convert from old bool type to new bitfield } else { // New style short - levelChunk->terrainPopulated = tag->getShort(L"TerrainPopulatedFlags"); + levelChunk->terrainPopulated = tag->getShort(L"TerrainPopulatedFlags"); // If all neighbours have been post-processed, then we should have done the post-post-processing now. Check that this is set as if it isn't then we won't be able // to send network data for chunks, and we won't ever try and set it again as all the directional flags are now already set - should only be an issue for old maps // before this flag was added. diff --git a/Minecraft.World/Packet.cpp b/Minecraft.World/Packet.cpp index 0a59204c..8bac8629 100644 --- a/Minecraft.World/Packet.cpp +++ b/Minecraft.World/Packet.cpp @@ -30,7 +30,7 @@ void Packet::staticCtor() map(8, true, false, true, true, typeid(SetHealthPacket), SetHealthPacket::create); map(9, true, true, true, false, typeid(RespawnPacket), RespawnPacket::create); - map(10, true, true, true, false, typeid(MovePlayerPacket), MovePlayerPacket::create); + map(10, true, true, true, false, typeid(MovePlayerPacket), MovePlayerPacket::create); map(11, true, true, true, true, typeid(MovePlayerPacket::Pos), MovePlayerPacket::Pos::create); map(12, true, true, true, true, typeid(MovePlayerPacket::Rot), MovePlayerPacket::Rot::create); map(13, true, true, true, true, typeid(MovePlayerPacket::PosRot), MovePlayerPacket::PosRot::create); @@ -254,7 +254,7 @@ void Packet::renderAllPacketStats() void Packet::renderAllPacketStatsKey() { -#ifndef _CONTENT_PACKAGE +#ifndef _CONTENT_PACKAGE #if PACKET_ENABLE_STAT_TRACKING Minecraft *pMinecraft = Minecraft::GetInstance(); int total = Packet::renderableStats.size(); @@ -271,9 +271,9 @@ void Packet::renderAllPacketStatsKey() #endif } -__int64 Packet::getIndexedStatValue(unsigned int samplePos, unsigned int renderableId) +int64_t Packet::getIndexedStatValue(unsigned int samplePos, unsigned int renderableId) { - __int64 val = 0; + int64_t val = 0; #ifndef _CONTENT_PACKAGE #if PACKET_ENABLE_STAT_TRACKING @@ -285,13 +285,13 @@ __int64 Packet::getIndexedStatValue(unsigned int samplePos, unsigned int rendera } -shared_ptr Packet::getPacket(int id) +shared_ptr Packet::getPacket(int id) { // 4J - removed try/catch // try // { return idToCreateMap[id](); - // } + // } // catch (exception e) // { // // TODO 4J JEV print stack trace, newInstance doesnt throw an exception in c++ yet. @@ -366,11 +366,11 @@ shared_ptr Packet::readPacket(DataInputStream *dis, bool isServer) // th packet = getPacket(id); if (packet == NULL) assert(false);//throw new IOException(wstring(L"Bad packet id ") + _toString(id)); - + //app.DebugPrintf("%s reading packet %d\n", isServer ? "Server" : "Client", packet->getId()); packet->read(dis); // } - // catch (EOFException e) + // catch (EOFException e) // { // // reached end of stream // OutputDebugString("Reached end of stream"); @@ -409,7 +409,7 @@ void Packet::writePacket(shared_ptr packet, DataOutputStream *dos) // th void Packet::writeUtf(const wstring& value, DataOutputStream *dos) // throws IOException TODO 4J JEV, should this declare a throws? { #if 0 - if (value.length() > Short::MAX_VALUE) + if (value.length() > Short::MAX_VALUE) { throw new IOException(L"String too big"); } @@ -437,7 +437,7 @@ wstring Packet::readUtf(DataInputStream *dis, int maxLength) // throws IOExcepti } wstring builder = L""; - for (int i = 0; i < stringLength; i++) + for (int i = 0; i < stringLength; i++) { wchar_t rc = dis->readChar(); builder.push_back( rc ); @@ -455,12 +455,12 @@ void Packet::PacketStatistics::addPacket(int bytes) count++; totalSize += bytes; - // 4J Added + // 4J Added countSamples[samplesPos & (512 - 1)]++; sizeSamples[samplesPos & (512 - 1)] += (unsigned int) bytes; } -int Packet::PacketStatistics::getCount() +int Packet::PacketStatistics::getCount() { return count; } @@ -489,7 +489,7 @@ void Packet::PacketStatistics::renderStats( ) #endif } -__int64 Packet::PacketStatistics::getCountSample(int samplePos) +int64_t Packet::PacketStatistics::getCountSample(int samplePos) { if(samplePos == 511) { diff --git a/Minecraft.World/Packet.h b/Minecraft.World/Packet.h index 60410df3..0bafe443 100644 --- a/Minecraft.World/Packet.h +++ b/Minecraft.World/Packet.h @@ -15,17 +15,17 @@ typedef shared_ptr (*packetCreateFn)(); class Packet { public: - class PacketStatistics + class PacketStatistics { private: int count; int totalSize; // 4J Added - __int64 countSamples[512]; - __int64 sizeSamples[512]; + int64_t countSamples[512]; + int64_t sizeSamples[512]; int samplesPos; - __int64 firstSampleTime; + int64_t firstSampleTime; public: @@ -39,7 +39,7 @@ public: // 4J Added void renderStats(); - __int64 getCountSample(int samplePos); + int64_t getCountSample(int samplePos); wstring getLegendString(); }; @@ -58,7 +58,7 @@ public: static void map(int id, bool receiveOnClient, bool receiveOnServer, bool sendToAnyClient, bool renderStats, const type_info& clazz, packetCreateFn ); public: - const __int64 createTime; + const int64_t createTime; Packet(); @@ -84,7 +84,7 @@ public: static void renderPacketStats(int id); static void renderAllPacketStats(); static void renderAllPacketStatsKey(); - static __int64 getIndexedStatValue(unsigned int samplePos, unsigned int renderableId); + static int64_t getIndexedStatValue(unsigned int samplePos, unsigned int renderableId); private : static unordered_map statistics; diff --git a/Minecraft.World/PerlinNoise.cpp b/Minecraft.World/PerlinNoise.cpp index b4fd8004..b4c65e55 100644 --- a/Minecraft.World/PerlinNoise.cpp +++ b/Minecraft.World/PerlinNoise.cpp @@ -77,8 +77,8 @@ doubleArray PerlinNoise::getRegion(doubleArray buffer, int x, int y, int z, int double xx = x * pow * xScale; double yy = y * pow * yScale; double zz = z * pow * zScale; - __int64 xb = Mth::lfloor(xx); - __int64 zb = Mth::lfloor(zz); + int64_t xb = Mth::lfloor(xx); + int64_t zb = Mth::lfloor(zz); xx -= xb; zz -= zb; xb %= 16777216; diff --git a/Minecraft.World/Random.cpp b/Minecraft.World/Random.cpp index 9176bf38..d4e3a545 100644 --- a/Minecraft.World/Random.cpp +++ b/Minecraft.World/Random.cpp @@ -1,4 +1,4 @@ -#include "stdafx.h" +#include "stdafx.h" #include "Random.h" #include "System.h" @@ -6,19 +6,19 @@ Random::Random() { // 4J - jave now uses the system nanosecond counter added to a "seedUniquifier" to get an initial seed. Our nanosecond timer is actually only millisecond accuate, so // use QueryPerformanceCounter here instead - __int64 seed; + int64_t seed; QueryPerformanceCounter((LARGE_INTEGER *)&seed); seed += 8682522807148012LL; setSeed(seed); } -Random::Random(__int64 seed) +Random::Random(int64_t seed) { setSeed(seed); } -void Random::setSeed(__int64 s) +void Random::setSeed(int64_t s) { this->seed = (s ^ 0x5DEECE66DLL) & ((1LL << 48) - 1); haveNextNextGaussian = false; @@ -41,7 +41,7 @@ void Random::nextBytes(byte *bytes, unsigned int count) double Random::nextDouble() { - return (((__int64)next(26) << 27) + next(27)) + return (((int64_t)next(26) << 27) + next(27)) / (double)(1LL << 53); } @@ -56,7 +56,7 @@ double Random::nextGaussian() { double v1, v2, s; do - { + { v1 = 2 * nextDouble() - 1; // between -1.0 and 1.0 v2 = 2 * nextDouble() - 1; // between -1.0 and 1.0 s = v1 * v1 + v2 * v2; @@ -79,7 +79,7 @@ int Random::nextInt(int n) if ((n & -n) == n) // i.e., n is a power of 2 - return (int)(((__int64)next(31) * n) >> 31); // 4J Stu - Made __int64 instead of long + return (int)(((int64_t)next(31) * n) >> 31); // 4J Stu - Made int64_t instead of long int bits, val; do @@ -95,9 +95,9 @@ float Random::nextFloat() return next(24) / ((float)(1 << 24)); } -__int64 Random::nextLong() +int64_t Random::nextLong() { - return ((__int64)next(32) << 32) + next(32); + return ((int64_t)next(32) << 32) + next(32); } bool Random::nextBoolean() diff --git a/Minecraft.World/Random.h b/Minecraft.World/Random.h index 9af3a3c2..cfb6af26 100644 --- a/Minecraft.World/Random.h +++ b/Minecraft.World/Random.h @@ -3,21 +3,21 @@ class Random { private: - __int64 seed; + int64_t seed; bool haveNextNextGaussian; double nextNextGaussian; protected: int next(int bits); public: Random(); - Random(__int64 seed); - void setSeed(__int64 s); + Random(int64_t seed); + void setSeed(int64_t s); void nextBytes(byte *bytes, unsigned int count); double nextDouble(); double nextGaussian(); int nextInt(); int nextInt(int to); float nextFloat(); - __int64 nextLong(); + int64_t nextLong(); bool nextBoolean(); }; \ No newline at end of file diff --git a/Minecraft.World/RandomLevelSource.cpp b/Minecraft.World/RandomLevelSource.cpp index 4e26134a..277ff1f7 100644 --- a/Minecraft.World/RandomLevelSource.cpp +++ b/Minecraft.World/RandomLevelSource.cpp @@ -23,7 +23,7 @@ static PerlinNoise_DataIn g_depthNoise_SPU __attribute__((__aligned__(16))); const double RandomLevelSource::SNOW_SCALE = 0.3; const double RandomLevelSource::SNOW_CUTOFF = 0.5; -RandomLevelSource::RandomLevelSource(Level *level, __int64 seed, bool generateStructures) : generateStructures( generateStructures ) +RandomLevelSource::RandomLevelSource(Level *level, int64_t seed, bool generateStructures) : generateStructures( generateStructures ) { m_XZSize = level->getLevelData()->getXZSize(); @@ -160,7 +160,7 @@ void RandomLevelSource::prepareHeights(int xOffs, int zOffs, byteArray blocks) const int worldSize = m_XZSize * 16; const int falloffStart = 32; // chunks away from edge were we start doing fall-off const float falloffMax = 128.0f; // max value we need to get to falloff by the edge of the map - + int xxx = ( ( xOffs * 16 ) + x + ( xc * CHUNK_WIDTH ) ); int zzz = ( ( zOffs * 16 ) + z + ( zc * CHUNK_WIDTH ) ); @@ -320,7 +320,7 @@ void RandomLevelSource::buildSurfaces(int xOffs, int zOffs, byteArray blocks, Bi run = runDepth; if (y >= waterHeight - 1) blocks[offs] = top; else blocks[offs] = material; - } + } else if (run > 0) { run--; @@ -389,7 +389,7 @@ LevelChunk *RandomLevelSource::getChunk(int xOffs, int zOffs) // addCaves(xOffs, zOffs, blocks); // addTowns(xOffs, zOffs, blocks); -// levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method +// levelChunk->recalcHeightmap(); // 4J - removed & moved into its own method // 4J - this now creates compressed block data from the blocks array passed in, so moved it until after the blocks are actually finalised. We also // now need to free the passed in blocks as the LevelChunk doesn't use the passed in allocation anymore. @@ -504,7 +504,7 @@ doubleArray RandomLevelSource::getHeights(doubleArray buffer, int x, int y, int sss = sss * 0.9f + 0.1f; ddd = (ddd * 4 - 1) / 8.0f; - + double rdepth = (dr[pp] / 8000.0); if (rdepth < 0) rdepth = -rdepth * 0.3; rdepth = rdepth * 3.0 - 2.0; @@ -515,7 +515,7 @@ doubleArray RandomLevelSource::getHeights(doubleArray buffer, int x, int y, int if (rdepth < -1) rdepth = -1; rdepth = rdepth / 1.4; rdepth /= 2; - } + } else { if (rdepth > 1) rdepth = 1; @@ -652,8 +652,8 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) } pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); bool hasVillage = false; @@ -712,7 +712,7 @@ void RandomLevelSource::postProcess(ChunkSource *parent, int xt, int zt) PIXBeginNamedEvent(0,"Biome decorate"); biome->decorate(level, pprandom, xo, zo); PIXEndNamedEvent(); - + app.processSchematics(parent->getChunk(xt,zt)); MobSpawner::postProcessSpawnMobs(level, biome, xo + 8, zo + 8, 16, 16, pprandom); diff --git a/Minecraft.World/RandomLevelSource.h b/Minecraft.World/RandomLevelSource.h index d71028b1..b80ac6c6 100644 --- a/Minecraft.World/RandomLevelSource.h +++ b/Minecraft.World/RandomLevelSource.h @@ -47,7 +47,7 @@ private: floatArray pows; public: - RandomLevelSource(Level *level, __int64 seed, bool generateStructures); + RandomLevelSource(Level *level, int64_t seed, bool generateStructures); ~RandomLevelSource(); public: @@ -88,5 +88,5 @@ public: public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/RegionFile.cpp b/Minecraft.World/RegionFile.cpp index 2cfd9078..5c29f94e 100644 --- a/Minecraft.World/RegionFile.cpp +++ b/Minecraft.World/RegionFile.cpp @@ -19,7 +19,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) chunkTimestamps = new int[SECTOR_INTS]; memset(chunkTimestamps,0,SECTOR_BYTES); - /* 4J Jev, using files instead of strings: + /* 4J Jev, using files instead of strings: strncpy(fileName,path,MAX_PATH_SIZE); */ fileName = path; @@ -30,7 +30,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) // 4J - removed try/catch // try { - + /* 4J - Removed as _lastModifed not used and this is always failing as checking wrong thing if( path->exists() ) { @@ -45,7 +45,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) { // 4J altered - the original code used to write out 2 empty sectors here, which we don't want to do as we might be at a point where we shouldn't be touching the save file. // This now happens in insertInitialSectors when we do a first write to the region - m_bIsEmpty = true; + m_bIsEmpty = true; sizeDelta += SECTOR_BYTES * 2; } @@ -70,7 +70,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) } /* set up the available sector map */ - + int nSectors; if( m_bIsEmpty ) // 4J - added this case for our empty files that we now don't create { @@ -133,7 +133,7 @@ RegionFile::RegionFile(ConsoleSaveFile *saveFile, File *path) void RegionFile::writeAllOffsets() // used for the file ConsoleSaveFile conversion between platforms { - if(m_bIsEmpty == false) + if(m_bIsEmpty == false) { // save all the offsets and timestamps m_saveFile->LockSaveAccess(); @@ -158,7 +158,7 @@ RegionFile::~RegionFile() m_saveFile->closeHandle( fileEntry ); } -__int64 RegionFile::lastModified() +int64_t RegionFile::lastModified() { return _lastModified; } @@ -198,9 +198,9 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was m_saveFile->LockSaveAccess(); - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN); - + unsigned int length; unsigned int decompLength; unsigned int readDecompLength; @@ -227,7 +227,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was if (length > SECTOR_BYTES * numSectors) { // debugln("READ", x, z, "invalid length: " + length + " > 4096 * " + numSectors); - + m_saveFile->ReleaseSaveAccess(); return NULL; } @@ -257,7 +257,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was delete [] data; // 4J - was InflaterInputStream in here too, but we've already decompressed - DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) )); + DataInputStream *ret = new DataInputStream(new ByteArrayInputStream( byteArray( decomp, readDecompLength) )); return ret; // } catch (IOException e) { @@ -269,7 +269,7 @@ DataInputStream *RegionFile::getChunkDataInputStream(int x, int z) // TODO - was DataOutputStream *RegionFile::getChunkDataOutputStream(int x, int z) { // 4J - was DeflatorOutputStream in here too, but we've already compressed - return new DataOutputStream( new ChunkBuffer(this, x, z)); + return new DataOutputStream( new ChunkBuffer(this, x, z)); } /* write a chunk at (x,z) with length bytes of data to disk */ @@ -372,7 +372,7 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync * file */ // debug("SAVE", x, z, length, "grow"); - //SetFilePointer(file,0,0,FILE_END); + //SetFilePointer(file,0,0,FILE_END); m_saveFile->setFilePointer( fileEntry, 0, NULL, FILE_END ); sectorNumber = (int)sectorFree->size(); @@ -406,12 +406,12 @@ void RegionFile::write(int x, int z, byte *data, int length) // TODO - was sync void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int compLength) { DWORD numberOfBytesWritten = 0; - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); // 4J - this differs a bit from the java file format. Java has length stored as an int, then a type as a byte, then length-1 bytes of data // We store length and decompression length as ints, then length bytes of xbox LZX compressed data - + // 4J Stu - We need to do the compression at a level above this, where it is checking for free space compLength |= 0x80000000; // 4J - signify that this has been encoded with RLE method ( see code in getChunkDataInputStream() for matching detection of this) @@ -425,7 +425,7 @@ void RegionFile::write(int sectorNumber, byte *data, int length, unsigned int co void RegionFile::zero(int sectorNumber, int length) { DWORD numberOfBytesWritten = 0; - //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); + //SetFilePointer(file,sectorNumber * SECTOR_BYTES,0,FILE_BEGIN); m_saveFile->setFilePointer( fileEntry, sectorNumber * SECTOR_BYTES, NULL, FILE_BEGIN ); m_saveFile->zeroFile( fileEntry, length, &numberOfBytesWritten ); } @@ -473,7 +473,7 @@ void RegionFile::setOffset(int x, int z, int offset) DWORD numberOfBytesWritten = 0; offsets[x + z * 32] = offset; m_saveFile->setFilePointer( fileEntry, (x + z * 32) * 4, NULL, FILE_BEGIN ); - + m_saveFile->writeFile(fileEntry,&offset,4,&numberOfBytesWritten); } @@ -487,7 +487,7 @@ void RegionFile::setTimestamp(int x, int z, int value) DWORD numberOfBytesWritten = 0; chunkTimestamps[x + z * 32] = value; m_saveFile->setFilePointer( fileEntry, SECTOR_BYTES + (x + z * 32) * 4, NULL, FILE_BEGIN ); - + m_saveFile->writeFile(fileEntry,&value,4,&numberOfBytesWritten); } diff --git a/Minecraft.World/RegionFile.h b/Minecraft.World/RegionFile.h index 0717c8c2..520ca6a1 100644 --- a/Minecraft.World/RegionFile.h +++ b/Minecraft.World/RegionFile.h @@ -16,7 +16,7 @@ private: static const int VERSION_GZIP = 1; static const int VERSION_DEFLATE = 2; static const int VERSION_XBOX = 3; - + static const int SECTOR_BYTES = 4096; static const int SECTOR_INTS = SECTOR_BYTES / 4; @@ -31,7 +31,7 @@ private: int *chunkTimestamps; vector *sectorFree; int sizeDelta; - __int64 _lastModified; + int64_t _lastModified; bool m_bIsEmpty; // 4J added public: @@ -39,7 +39,7 @@ public: ~RegionFile(); /* the modification date of the region file when it was first opened */ - __int64 lastModified(); + int64_t lastModified(); /* gets how much the region file has grown since it was last checked */ int getSizeDelta(); diff --git a/Minecraft.World/RegionHillsLayer.cpp b/Minecraft.World/RegionHillsLayer.cpp index dad114b0..a1e17524 100644 --- a/Minecraft.World/RegionHillsLayer.cpp +++ b/Minecraft.World/RegionHillsLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "RegionHillsLayer.h" -RegionHillsLayer::RegionHillsLayer(__int64 seed, shared_ptr parent) : Layer(seed) +RegionHillsLayer::RegionHillsLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RegionHillsLayer.h b/Minecraft.World/RegionHillsLayer.h index 30d7eced..5ad0bb75 100644 --- a/Minecraft.World/RegionHillsLayer.h +++ b/Minecraft.World/RegionHillsLayer.h @@ -5,7 +5,7 @@ class RegionHillsLayer : public Layer { public: - RegionHillsLayer(__int64 seed, shared_ptr parent); + RegionHillsLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RespawnPacket.cpp b/Minecraft.World/RespawnPacket.cpp index 5c04bbeb..ecc0b7f0 100644 --- a/Minecraft.World/RespawnPacket.cpp +++ b/Minecraft.World/RespawnPacket.cpp @@ -5,7 +5,7 @@ #include "RespawnPacket.h" #include "LevelType.h" -RespawnPacket::RespawnPacket() +RespawnPacket::RespawnPacket() { this->dimension = 0; this->difficulty = 1; @@ -19,7 +19,7 @@ RespawnPacket::RespawnPacket() m_hellScale = HELL_LEVEL_MAX_SCALE; } -RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) +RespawnPacket::RespawnPacket(char dimension, int64_t mapSeed, int mapHeight, GameType *playerGameType, char difficulty, LevelType *pLevelType, bool newSeaLevel, int newEntityId, int xzSize, int hellScale) { this->dimension = dimension; this->mapSeed = mapSeed; @@ -35,7 +35,7 @@ RespawnPacket::RespawnPacket(char dimension, __int64 mapSeed, int mapHeight, Gam } -void RespawnPacket::handle(PacketListener *listener) +void RespawnPacket::handle(PacketListener *listener) { listener->handleRespawn(shared_from_this()); } @@ -47,7 +47,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException mapHeight = dis->readShort(); wstring typeName = readUtf(dis, 16); m_pLevelType = LevelType::getLevelType(typeName); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { m_pLevelType = LevelType::lvl_normal; } @@ -63,16 +63,16 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException } -void RespawnPacket::write(DataOutputStream *dos) //throws IOException +void RespawnPacket::write(DataOutputStream *dos) //throws IOException { dos->writeByte(dimension); dos->writeByte(playerGameType->getId()); dos->writeShort(mapHeight); - if (m_pLevelType == NULL) + if (m_pLevelType == NULL) { writeUtf(L"", dos); - } - else + } + else { writeUtf(m_pLevelType->getGeneratorName(), dos); } @@ -86,10 +86,10 @@ void RespawnPacket::write(DataOutputStream *dos) //throws IOException #endif } -int RespawnPacket::getEstimatedSize() +int RespawnPacket::getEstimatedSize() { int length=0; - if (m_pLevelType != NULL) + if (m_pLevelType != NULL) { length = (int)m_pLevelType->getGeneratorName().length(); } diff --git a/Minecraft.World/RespawnPacket.h b/Minecraft.World/RespawnPacket.h index dc341ea1..3caf1ee3 100644 --- a/Minecraft.World/RespawnPacket.h +++ b/Minecraft.World/RespawnPacket.h @@ -11,7 +11,7 @@ class RespawnPacket : public Packet, public enable_shared_from_thisparent) : Layer(seed) +RiverInitLayer::RiverInitLayer(int64_t seed, shared_ptrparent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/RiverInitLayer.h b/Minecraft.World/RiverInitLayer.h index 6deb50e9..bc8dca1b 100644 --- a/Minecraft.World/RiverInitLayer.h +++ b/Minecraft.World/RiverInitLayer.h @@ -5,7 +5,7 @@ class RiverInitLayer : public Layer { public: - RiverInitLayer(__int64 seed, shared_ptrparent); + RiverInitLayer(int64_t seed, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverLayer.cpp b/Minecraft.World/RiverLayer.cpp index 8f805bab..14cf3142 100644 --- a/Minecraft.World/RiverLayer.cpp +++ b/Minecraft.World/RiverLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverLayer::RiverLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +RiverLayer::RiverLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/RiverLayer.h b/Minecraft.World/RiverLayer.h index 657ac07c..a76d3fab 100644 --- a/Minecraft.World/RiverLayer.h +++ b/Minecraft.World/RiverLayer.h @@ -5,6 +5,6 @@ class RiverLayer : public Layer { public: - RiverLayer(__int64 seedMixup, shared_ptrparent); + RiverLayer(int64_t seedMixup, shared_ptrparent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/RiverMixerLayer.cpp b/Minecraft.World/RiverMixerLayer.cpp index 62dfdd6c..4de49245 100644 --- a/Minecraft.World/RiverMixerLayer.cpp +++ b/Minecraft.World/RiverMixerLayer.cpp @@ -2,13 +2,13 @@ #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.level.newbiome.layer.h" -RiverMixerLayer::RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) +RiverMixerLayer::RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers) : Layer(seed) { this->biomes = biomes; this->rivers = rivers; } -void RiverMixerLayer::init(__int64 seed) +void RiverMixerLayer::init(int64_t seed) { biomes->init(seed); rivers->init(seed); diff --git a/Minecraft.World/RiverMixerLayer.h b/Minecraft.World/RiverMixerLayer.h index eec51610..3a069c41 100644 --- a/Minecraft.World/RiverMixerLayer.h +++ b/Minecraft.World/RiverMixerLayer.h @@ -9,8 +9,8 @@ private: shared_ptrrivers; public: - RiverMixerLayer(__int64 seed, shared_ptrbiomes, shared_ptrrivers); + RiverMixerLayer(int64_t seed, shared_ptrbiomes, shared_ptrrivers); - virtual void init(__int64 seed); + virtual void init(int64_t seed); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SetTimePacket.cpp b/Minecraft.World/SetTimePacket.cpp index 2f707970..1f0701eb 100644 --- a/Minecraft.World/SetTimePacket.cpp +++ b/Minecraft.World/SetTimePacket.cpp @@ -6,12 +6,12 @@ -SetTimePacket::SetTimePacket() +SetTimePacket::SetTimePacket() { time = 0; } -SetTimePacket::SetTimePacket(__int64 time) +SetTimePacket::SetTimePacket(int64_t time) { this->time = time; } @@ -21,7 +21,7 @@ void SetTimePacket::read(DataInputStream *dis) //throws IOException time = dis->readLong(); } -void SetTimePacket::write(DataOutputStream *dos) //throws IOException +void SetTimePacket::write(DataOutputStream *dos) //throws IOException { dos->writeLong(time); } diff --git a/Minecraft.World/SetTimePacket.h b/Minecraft.World/SetTimePacket.h index 5b658a0b..b7d3e645 100644 --- a/Minecraft.World/SetTimePacket.h +++ b/Minecraft.World/SetTimePacket.h @@ -6,10 +6,10 @@ using namespace std; class SetTimePacket : public Packet, public enable_shared_from_this { public: - __int64 time; + int64_t time; SetTimePacket(); - SetTimePacket(__int64 time); + SetTimePacket(int64_t time); virtual void read(DataInputStream *dis); virtual void write(DataOutputStream *dos); diff --git a/Minecraft.World/ShoreLayer.cpp b/Minecraft.World/ShoreLayer.cpp index 297571f5..7ae52557 100644 --- a/Minecraft.World/ShoreLayer.cpp +++ b/Minecraft.World/ShoreLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "net.minecraft.world.level.biome.h" -ShoreLayer::ShoreLayer(__int64 seed, shared_ptr parent) : Layer(seed) +ShoreLayer::ShoreLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/ShoreLayer.h b/Minecraft.World/ShoreLayer.h index 96aea152..a7053004 100644 --- a/Minecraft.World/ShoreLayer.h +++ b/Minecraft.World/ShoreLayer.h @@ -4,6 +4,6 @@ class ShoreLayer : public Layer { public: - ShoreLayer(__int64 seed, shared_ptr parent); + ShoreLayer(int64_t seed, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SkyIslandDimension.cpp b/Minecraft.World/SkyIslandDimension.cpp index 0746c92c..aa68bd5e 100644 --- a/Minecraft.World/SkyIslandDimension.cpp +++ b/Minecraft.World/SkyIslandDimension.cpp @@ -16,7 +16,7 @@ ChunkSource *SkyIslandDimension::createRandomLevelSource() const return new SkyIslandRandomLevelSource(level, level->getSeed()); } -float SkyIslandDimension::getTimeOfDay(__int64 time, float a) const +float SkyIslandDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/Minecraft.World/SmoothLayer.cpp b/Minecraft.World/SmoothLayer.cpp index a5545cc5..e94ae36d 100644 --- a/Minecraft.World/SmoothLayer.cpp +++ b/Minecraft.World/SmoothLayer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.level.newbiome.layer.h" -SmoothLayer::SmoothLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothLayer::SmoothLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/SmoothLayer.h b/Minecraft.World/SmoothLayer.h index eec3f19e..14e3d152 100644 --- a/Minecraft.World/SmoothLayer.h +++ b/Minecraft.World/SmoothLayer.h @@ -5,7 +5,7 @@ class SmoothLayer : public Layer { public: - SmoothLayer(__int64 seedMixup, shared_ptrparent); + SmoothLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/SmoothZoomLayer.cpp b/Minecraft.World/SmoothZoomLayer.cpp index 3e1c55a1..2df34a3b 100644 --- a/Minecraft.World/SmoothZoomLayer.cpp +++ b/Minecraft.World/SmoothZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -SmoothZoomLayer::SmoothZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +SmoothZoomLayer::SmoothZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -50,7 +50,7 @@ intArray SmoothZoomLayer::getArea(int xo, int yo, int w, int h) return result; } -shared_ptrSmoothZoomLayer::zoom(__int64 seed, shared_ptrsup, int count) +shared_ptrSmoothZoomLayer::zoom(int64_t seed, shared_ptrsup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/SmoothZoomLayer.h b/Minecraft.World/SmoothZoomLayer.h index b2ac4e78..90cc292e 100644 --- a/Minecraft.World/SmoothZoomLayer.h +++ b/Minecraft.World/SmoothZoomLayer.h @@ -5,8 +5,8 @@ class SmoothZoomLayer : public Layer { public: - SmoothZoomLayer(__int64 seedMixup, shared_ptrparent); + SmoothZoomLayer(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); - static shared_ptrzoom(__int64 seed, shared_ptrsup, int count); + static shared_ptrzoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/Socket.h b/Minecraft.World/Socket.h index 0019f984..c4ec9fc8 100644 --- a/Minecraft.World/Socket.h +++ b/Minecraft.World/Socket.h @@ -36,7 +36,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; @@ -68,7 +68,7 @@ private: virtual int read(byteArray b); virtual int read(byteArray b, unsigned int offset, unsigned int length); virtual void close(); - virtual __int64 skip(__int64 n) { return n; } // 4J Stu - Not implemented + virtual int64_t skip(int64_t n) { return n; } // 4J Stu - Not implemented virtual void flush() {} }; class SocketOutputStreamNetwork : public SocketOutputStream @@ -86,13 +86,13 @@ private: virtual void close(); virtual void flush() {} }; - + bool m_hostServerConnection; // true if this is the connection between the host player and server bool m_hostLocal; // true if this player on the same machine as the host int m_end; // 0 for client side or 1 for host side // For local connections between the host player and the server - static CRITICAL_SECTION s_hostQueueLock[2]; + static CRITICAL_SECTION s_hostQueueLock[2]; static std::queue s_hostQueue[2]; static SocketOutputStreamLocal *s_hostOutStream[2]; static SocketInputStreamLocal *s_hostInStream[2]; @@ -108,7 +108,7 @@ private: static ServerConnection *s_serverConnection; BYTE networkPlayerSmallId; -public: +public: C4JThread::Event* m_socketClosedEvent; INetworkPlayer *getPlayer(); diff --git a/Minecraft.World/SparseDataStorage.cpp b/Minecraft.World/SparseDataStorage.cpp index 6db131e7..780c9819 100644 --- a/Minecraft.World/SparseDataStorage.cpp +++ b/Minecraft.World/SparseDataStorage.cpp @@ -40,7 +40,7 @@ SparseDataStorage::SparseDataStorage() // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -59,7 +59,7 @@ SparseDataStorage::SparseDataStorage(bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef DATA_COMPRESSION_STATS count = 128; @@ -70,7 +70,7 @@ SparseDataStorage::~SparseDataStorage() { unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); // Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc - + #ifdef _XBOX if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE ) { @@ -87,7 +87,7 @@ SparseDataStorage::~SparseDataStorage() SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseDataStorage::SparseDataStorage(SparseDataStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -126,7 +126,7 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) for( int y = 0; y < 128; y++ ) { bool all0 = true; - + for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked { int pos = ( xz << 7 ) | y; @@ -176,9 +176,9 @@ void SparseDataStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -230,7 +230,7 @@ int SparseDataStorage::get(int x, int y, int z) { unsigned char *planeIndices, *data; getPlaneIndicesAndData(&planeIndices, &data); - + if( planeIndices[y] == ALL_0_INDEX ) { return 0; @@ -370,7 +370,7 @@ int SparseDataStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z0 } } ptrdiff_t count = pucOut - &dataInOut.data[offset]; - + return (int)count; } @@ -380,7 +380,7 @@ void SparseDataStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -388,9 +388,9 @@ void SparseDataStorage::addNewPlane(int y) // Find out what to prefill the newly allocated line with unsigned char planeIndex = lastDataPointer[y]; - + if( planeIndex < ALL_0_INDEX ) return; // Something has already allocated this line - we're done - + int linesUsed = lastLinesUsed + 1; // Allocate new memory storage, copy over anything from old storage, and initialise remainder @@ -401,14 +401,14 @@ void SparseDataStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -473,20 +473,20 @@ void SparseDataStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseDataStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseDataStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -508,7 +508,7 @@ int SparseDataStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -558,13 +558,13 @@ int SparseDataStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -576,7 +576,7 @@ int SparseDataStorage::compress() { // Success queueForDelete( planeIndices ); -// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); +// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); #ifdef DATA_COMPRESSION_STATS count = planesToAlloc; #endif @@ -617,9 +617,9 @@ void SparseDataStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount(newDataAndCount); } diff --git a/Minecraft.World/SparseDataStorage.h b/Minecraft.World/SparseDataStorage.h index 93d5c424..16289cda 100644 --- a/Minecraft.World/SparseDataStorage.h +++ b/Minecraft.World/SparseDataStorage.h @@ -18,9 +18,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -36,7 +36,7 @@ class SparseDataStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -64,7 +64,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/Minecraft.World/SparseLightStorage.cpp b/Minecraft.World/SparseLightStorage.cpp index f9a2f0cb..a0ba41b1 100644 --- a/Minecraft.World/SparseLightStorage.cpp +++ b/Minecraft.World/SparseLightStorage.cpp @@ -40,7 +40,7 @@ SparseLightStorage::SparseLightStorage(bool sky) // Data and count packs together the pointer to our data and the count of planes allocated - 127 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x007F000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x007F000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 127; @@ -59,7 +59,7 @@ SparseLightStorage::SparseLightStorage(bool sky, bool isUpper) // Data and count packs together the pointer to our data and the count of planes allocated - 0 planes allocated in this case #pragma warning ( disable : 4826 ) - dataAndCount = 0x0000000000000000L | (( (__int64) planeIndices ) & 0x0000ffffffffffffL); + dataAndCount = 0x0000000000000000L | (( (int64_t) planeIndices ) & 0x0000ffffffffffffL); #pragma warning ( default : 4826 ) #ifdef LIGHT_COMPRESSION_STATS count = 0; @@ -70,7 +70,7 @@ SparseLightStorage::~SparseLightStorage() { unsigned char *indicesAndData = (unsigned char *)(dataAndCount & 0x0000ffffffffffff); // Determine correct means to free this data - could have been allocated either with XPhysicalAlloc or malloc - + #ifdef _XBOX if( (unsigned int)indicesAndData >= MM_PHYSICAL_4KB_BASE ) { @@ -87,7 +87,7 @@ SparseLightStorage::~SparseLightStorage() SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) { // Extra details of source storage - __int64 sourceDataAndCount = copyFrom->dataAndCount; + int64_t sourceDataAndCount = copyFrom->dataAndCount; unsigned char *sourceIndicesAndData = (unsigned char *)(sourceDataAndCount & 0x0000ffffffffffff); int sourceCount = (sourceDataAndCount >> 48 ) & 0xffff; @@ -97,7 +97,7 @@ SparseLightStorage::SparseLightStorage(SparseLightStorage *copyFrom) // AP - I've moved this to be before the memcpy because of a very strange bug on vita. Sometimes dataAndCount wasn't valid in time when ::get was called. // This should never happen and this isn't a proper solution but fixes it for now. #pragma warning ( disable : 4826 ) - dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((__int64) destIndicesAndData ) & 0x0000ffffffffffffL ); + dataAndCount = ( sourceDataAndCount & 0xffff000000000000L ) | ( ((int64_t) destIndicesAndData ) & 0x0000ffffffffffffL ); #pragma warning ( default : 4826 ) XMemCpy( destIndicesAndData, sourceIndicesAndData, sourceCount * 128 + 128 ); @@ -125,7 +125,7 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) { bool all0 = true; bool all15 = true; - + for( int xz = 0; xz < 256; xz++ ) // 256 in loop as 16 x 16 separate bytes need checked { int pos = ( xz << 7 ) | y; @@ -180,9 +180,9 @@ void SparseLightStorage::setData(byteArray dataIn, unsigned int inOffset) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) planeIndices) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) planeIndices) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)allocatedPlaneCount) << 48; + newDataAndCount |= ((int64_t)allocatedPlaneCount) << 48; updateDataAndCount( newDataAndCount ); } @@ -245,7 +245,7 @@ int SparseLightStorage::get(int x, int y, int z) { unsigned char *planeIndices, *data; getPlaneIndicesAndData(&planeIndices, &data); - + if( planeIndices[y] == ALL_0_INDEX ) { return 0; @@ -312,7 +312,7 @@ void SparseLightStorage::setAllBright() } // Data and count packs together the pointer to our data and the count of planes allocated, which is currently zero #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ( (__int64) planeIndices ) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ( (int64_t) planeIndices ) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) updateDataAndCount( newDataAndCount ); @@ -375,7 +375,7 @@ int SparseLightStorage::getDataRegion(byteArray dataInOut, int x0, int y0, int z } } ptrdiff_t count = pucOut - &dataInOut.data[offset]; - + return (int)count; } @@ -385,7 +385,7 @@ void SparseLightStorage::addNewPlane(int y) do { // Get last packed data pointer & count - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; // Unpack count & data pointer int lastLinesUsed = (int)(( lastDataAndCount >> 48 ) & 0xffff); @@ -407,14 +407,14 @@ void SparseLightStorage::addNewPlane(int y) // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)linesUsed) << 48; + newDataAndCount |= ((int64_t)linesUsed) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -479,20 +479,20 @@ void SparseLightStorage::tick() } // Update storage with a new values for dataAndCount, repeating as necessary if other simultaneous writes happen. -void SparseLightStorage::updateDataAndCount(__int64 newDataAndCount) +void SparseLightStorage::updateDataAndCount(int64_t newDataAndCount) { // Now actually assign this data to the storage. Just repeat until successful, there isn't any useful really that we can merge the results of this // with any other simultaneous writes that might be happening. bool success = false; do { - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *lastDataPointer = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); - + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + if( lastDataAndCount2 == lastDataAndCount ) { success = true; @@ -514,7 +514,7 @@ int SparseLightStorage::compress() unsigned char _planeIndices[128]; bool needsCompressed = false; - __int64 lastDataAndCount = dataAndCount; + int64_t lastDataAndCount = dataAndCount; unsigned char *planeIndices = (unsigned char *)(lastDataAndCount & 0x0000ffffffffffff); unsigned char *data = planeIndices + 128; @@ -575,13 +575,13 @@ int SparseLightStorage::compress() // Get new data and count packed info #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) newIndicesAndData) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) newIndicesAndData) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)planesToAlloc) << 48; + newDataAndCount |= ((int64_t)planesToAlloc) << 48; // Attempt to update the data & count atomically. This command will Only succeed if the data stored at // dataAndCount is equal to lastDataAndCount, and will return the value present just before the write took place - __int64 lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); + int64_t lastDataAndCount2 = InterlockedCompareExchangeRelease64( &dataAndCount, newDataAndCount, lastDataAndCount ); if( lastDataAndCount2 != lastDataAndCount ) { @@ -593,7 +593,7 @@ int SparseLightStorage::compress() { // Success queueForDelete( planeIndices ); -// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); +// printf("Successfully compressed to %d planes, to delete 0x%x\n", planesToAlloc, planeIndices); #ifdef LIGHT_COMPRESSION_STATS count = planesToAlloc; #endif @@ -634,9 +634,9 @@ void SparseLightStorage::read(DataInputStream *dis) dis->readFully(wrapper); #pragma warning ( disable : 4826 ) - __int64 newDataAndCount = ((__int64) dataPointer) & 0x0000ffffffffffffL; + int64_t newDataAndCount = ((int64_t) dataPointer) & 0x0000ffffffffffffL; #pragma warning ( default : 4826 ) - newDataAndCount |= ((__int64)count) << 48; + newDataAndCount |= ((int64_t)count) << 48; updateDataAndCount( newDataAndCount ); } diff --git a/Minecraft.World/SparseLightStorage.h b/Minecraft.World/SparseLightStorage.h index d05d7645..c4cfbd04 100644 --- a/Minecraft.World/SparseLightStorage.h +++ b/Minecraft.World/SparseLightStorage.h @@ -20,9 +20,9 @@ // To meet these requirements, this class is now implemented using a lock-free system, implemented using a read-copy-update (RCU) type algorithm. Some details... -// (1) The storage details for the class are now packed into a single __int64, which contains both a pointer to the data that is required and a count of how many planes worth +// (1) The storage details for the class are now packed into a single int64_t, which contains both a pointer to the data that is required and a count of how many planes worth // of storage are allocated. This allows the full storage to be updated atomically using compare and exchange operations (implemented with InterlockedCompareExchangeRelease64). -// (2) The data pointer referenced in this __int64 points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and +// (2) The data pointer referenced in this int64_t points to an area of memory which is 128 + 128 * plane_count bytes long, where the first 128 bytes stoere the plane indices, and // the rest of the data is variable in size to accomodate however many planes are required to be stored // (3) The RCU bit of the algorithm means that any read operations don't need to do any checks or locks at all. When the data needs to be updated, a copy of it is made and updated, // then an attempt is made to swap the new data in - if this succeeds then the old data pointer is deleted later at some point where we know nothing will be reading from it anymore. @@ -38,7 +38,7 @@ class SparseLightStorage friend class TileCompressData_SPU; private: // unsigned char planeIndices[128]; - __int64 dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) + int64_t dataAndCount; // Contains packed-together data pointer (lower 48-bits), and count of lines used (upper 16-bits) // unsigned char *data; // unsigned int allocatedPlaneCount; @@ -66,7 +66,7 @@ public: void addNewPlane(int y); void getPlaneIndicesAndData(unsigned char **planeIndices, unsigned char **data); - void updateDataAndCount(__int64 newDataAndCount); + void updateDataAndCount(int64_t newDataAndCount); int compress(); bool isCompressed(); diff --git a/Minecraft.World/StructureFeature.cpp b/Minecraft.World/StructureFeature.cpp index 5e8489f0..9a204d00 100644 --- a/Minecraft.World/StructureFeature.cpp +++ b/Minecraft.World/StructureFeature.cpp @@ -92,16 +92,16 @@ bool StructureFeature::isIntersection(int cellX, int cellZ) /////////////////////////////////////////// // 4J-PB - Below functions added from 1.2.3 /////////////////////////////////////////// -bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ) +bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ) { - //for (StructureStart structureStart : cachedStructures.values()) + //for (StructureStart structureStart : cachedStructures.values()) for(AUTO_VAR(it, cachedStructures.begin()); it != cachedStructures.end(); ++it) { StructureStart *pStructureStart = it->second; - if (pStructureStart->isValid()) + if (pStructureStart->isValid()) { - if (pStructureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ)) + if (pStructureStart->getBoundingBox()->intersects(cellX, cellZ, cellX, cellZ)) { /* Iterator it = structureStart.getPieces().iterator(); @@ -127,7 +127,7 @@ bool StructureFeature::isInsideFeature(int cellX, int cellY, int cellZ) return false; } -TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ) +TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ) { // this is a hack that will "force" the feature to generate positions @@ -135,10 +135,10 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i this->level = level; random->setSeed(level->getSeed()); - __int64 xScale = random->nextLong(); - __int64 zScale = random->nextLong(); - __int64 xx = (cellX >> 4) * xScale; - __int64 zz = (cellZ >> 4) * zScale; + int64_t xScale = random->nextLong(); + int64_t zScale = random->nextLong(); + int64_t xx = (cellX >> 4) * xScale; + int64_t zz = (cellZ >> 4) * zScale; random->setSeed(xx ^ zz ^ level->getSeed()); addFeature(level, cellX >> 4, cellZ >> 4, 0, 0, byteArray()); @@ -150,7 +150,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i { StructureStart *pStructureStart = it->second; - if (pStructureStart->isValid()) + if (pStructureStart->isValid()) { //StructurePiece *pStructurePiece = pStructureStart->getPieces().get(0); @@ -162,21 +162,21 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i int dz = locatorPosition->z - cellZ; double dist = dx + dx * dy * dy + dz * dz; - if (dist < minDistance) + if (dist < minDistance) { minDistance = dist; selected = locatorPosition; } } } - if (selected != NULL) + if (selected != NULL) { return selected; - } - else + } + else { vector *guesstimatedFeaturePositions = getGuesstimatedFeaturePositions(); - if (guesstimatedFeaturePositions != NULL) + if (guesstimatedFeaturePositions != NULL) { TilePos *pSelectedPos = new TilePos(0,0,0); @@ -187,7 +187,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i int dz = (*it).z - cellZ; double dist = dx + dx * dy * dy + dz * dz; - if (dist < minDistance) + if (dist < minDistance) { minDistance = dist; pSelectedPos->x = (*it).x; @@ -202,7 +202,7 @@ TilePos *StructureFeature::getNearestGeneratedFeature(Level *level, int cellX, i return NULL; } -vector *StructureFeature::getGuesstimatedFeaturePositions() +vector *StructureFeature::getGuesstimatedFeaturePositions() { return NULL; } diff --git a/Minecraft.World/StructureFeature.h b/Minecraft.World/StructureFeature.h index 642e6aad..22f4cd66 100644 --- a/Minecraft.World/StructureFeature.h +++ b/Minecraft.World/StructureFeature.h @@ -16,7 +16,7 @@ public: }; protected: - unordered_map<__int64, StructureStart *> cachedStructures; + unordered_map cachedStructures; public: ~StructureFeature(); @@ -29,12 +29,12 @@ public: bool isInsideFeature(int cellX, int cellY, int cellZ); TilePos *getNearestGeneratedFeature(Level *level, int cellX, int cellY, int cellZ); protected: - vector *getGuesstimatedFeaturePositions(); + vector *getGuesstimatedFeaturePositions(); /** * Returns true if the given chunk coordinates should hold a structure * source. - * + * * @param x * chunk x * @param z @@ -47,7 +47,7 @@ protected: /** * Creates a new instance of a structure source at the given chunk * coordinates. - * + * * @param x * chunk x * @param z diff --git a/Minecraft.World/SwampRiversLayer.cpp b/Minecraft.World/SwampRiversLayer.cpp index 68cef8a8..cd22cae8 100644 --- a/Minecraft.World/SwampRiversLayer.cpp +++ b/Minecraft.World/SwampRiversLayer.cpp @@ -3,7 +3,7 @@ #include "IntCache.h" #include "SwampRiversLayer.h" -SwampRiversLayer::SwampRiversLayer(__int64 seed, shared_ptr parent) : Layer(seed) +SwampRiversLayer::SwampRiversLayer(int64_t seed, shared_ptr parent) : Layer(seed) { this->parent = parent; } diff --git a/Minecraft.World/SwampRiversLayer.h b/Minecraft.World/SwampRiversLayer.h index f724ad82..97bab0f4 100644 --- a/Minecraft.World/SwampRiversLayer.h +++ b/Minecraft.World/SwampRiversLayer.h @@ -5,7 +5,7 @@ class SwampRiversLayer : public Layer { public: - SwampRiversLayer(__int64 seed, shared_ptr parent); + SwampRiversLayer(int64_t seed, shared_ptr parent); intArray getArea(int xo, int yo, int w, int h); }; \ No newline at end of file diff --git a/Minecraft.World/System.h b/Minecraft.World/System.h index 06e265cc..1d48b408 100644 --- a/Minecraft.World/System.h +++ b/Minecraft.World/System.h @@ -20,16 +20,16 @@ public: ArrayCopyFunctionDeclaration(Biome *) ArrayCopyFunctionDeclaration(int) - static __int64 nanoTime(); - static __int64 currentTimeMillis(); - static __int64 currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves + static int64_t nanoTime(); + static int64_t currentTimeMillis(); + static int64_t currentRealTimeMillis(); // 4J Added to get real-world time for timestamps in saves static void ReverseUSHORT(unsigned short *pusVal); static void ReverseSHORT(short *psVal); static void ReverseULONG(unsigned long *pulVal); static void ReverseULONG(unsigned int *pulVal); static void ReverseINT(int *piVal); - static void ReverseULONGLONG(__int64 *pullVal); + static void ReverseULONGLONG(int64_t *pullVal); static void ReverseWCHARA(WCHAR *pwch,int iLen); }; diff --git a/Minecraft.World/TheEndDimension.cpp b/Minecraft.World/TheEndDimension.cpp index ccc8641b..031d6de4 100644 --- a/Minecraft.World/TheEndDimension.cpp +++ b/Minecraft.World/TheEndDimension.cpp @@ -19,7 +19,7 @@ ChunkSource *TheEndDimension::createRandomLevelSource() const return new TheEndLevelRandomLevelSource(level, level->getSeed()); } -float TheEndDimension::getTimeOfDay(__int64 time, float a) const +float TheEndDimension::getTimeOfDay(int64_t time, float a) const { return 0.0f; } diff --git a/Minecraft.World/TheEndDimension.h b/Minecraft.World/TheEndDimension.h index 95bd6980..268be6f6 100644 --- a/Minecraft.World/TheEndDimension.h +++ b/Minecraft.World/TheEndDimension.h @@ -6,7 +6,7 @@ class TheEndDimension : public Dimension public: virtual void init(); virtual ChunkSource *createRandomLevelSource() const; - virtual float getTimeOfDay(__int64 time, float a) const; + virtual float getTimeOfDay(int64_t time, float a) const; virtual float *getSunriseColor(float td, float a); virtual Vec3 *getFogColor(float td, float a) const; virtual bool hasGround(); diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.cpp b/Minecraft.World/TheEndLevelRandomLevelSource.cpp index 46f3dbab..755f0d2f 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.cpp +++ b/Minecraft.World/TheEndLevelRandomLevelSource.cpp @@ -9,7 +9,7 @@ #include "net.minecraft.world.level.storage.h" #include "TheEndLevelRandomLevelSource.h" -TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, __int64 seed) +TheEndLevelRandomLevelSource::TheEndLevelRandomLevelSource(Level *level, int64_t seed) { m_XZSize = END_LEVEL_MIN_WIDTH; @@ -370,17 +370,17 @@ void TheEndLevelRandomLevelSource::postProcess(ChunkSource *parent, int xt, int // 4J - added. The original java didn't do any setting of the random seed here, and passes the level random to the biome decorator. // We'll be running our postProcess in parallel with getChunk etc. so we need to use a separate random - have used the same initialisation code as - // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation. + // used in RandomLevelSource::postProcess to make sure this random value is consistent for each world generation. pprandom->setSeed(level->getSeed()); - __int64 xScale = pprandom->nextLong() / 2 * 2 + 1; - __int64 zScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t xScale = pprandom->nextLong() / 2 * 2 + 1; + int64_t zScale = pprandom->nextLong() / 2 * 2 + 1; pprandom->setSeed(((xt * xScale) + (zt * zScale)) ^ level->getSeed()); Biome *biome = level->getBiome(xo + 16, zo + 16); biome->decorate(level, pprandom, xo, zo); // 4J - passing pprandom rather than level->random here to make this consistent with our parallel world generation HeavyTile::instaFall = false; - + app.processSchematics(parent->getChunk(xt,zt)); } @@ -418,4 +418,4 @@ TilePos *TheEndLevelRandomLevelSource::findNearestMapFeature(Level *level, const { return NULL; } - + diff --git a/Minecraft.World/TheEndLevelRandomLevelSource.h b/Minecraft.World/TheEndLevelRandomLevelSource.h index 2dc7f131..217918ee 100644 --- a/Minecraft.World/TheEndLevelRandomLevelSource.h +++ b/Minecraft.World/TheEndLevelRandomLevelSource.h @@ -9,7 +9,7 @@ public: static const double SNOW_CUTOFF; static const double SNOW_SCALE; static const bool FLOATING_ISLANDS; - + static const int CHUNK_HEIGHT = 4; static const int CHUNK_WIDTH = 8; private: @@ -30,7 +30,7 @@ private: Level *level; public: - TheEndLevelRandomLevelSource(Level *level, __int64 seed); + TheEndLevelRandomLevelSource(Level *level, int64_t seed); ~TheEndLevelRandomLevelSource(); void prepareHeights(int xOffs, int zOffs, byteArray blocks, BiomeArray biomes); @@ -56,5 +56,5 @@ public: public: virtual vector *getMobsAt(MobCategory *mobCategory, int x, int y, int z); - virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); + virtual TilePos *findNearestMapFeature(Level *level, const wstring& featureName, int x, int y, int z); }; diff --git a/Minecraft.World/Tile.cpp b/Minecraft.World/Tile.cpp index e0ef8dd9..77a62c8d 100644 --- a/Minecraft.World/Tile.cpp +++ b/Minecraft.World/Tile.cpp @@ -16,14 +16,14 @@ #include "net.minecraft.h" #include "Tile.h" -wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile."; +wstring Tile::TILE_DESCRIPTION_PREFIX = L"Tile."; const float Tile::INDESTRUCTIBLE_DESTROY_TIME = -1.0f; Tile::SoundType *Tile::SOUND_NORMAL = NULL; Tile::SoundType *Tile::SOUND_WOOD = NULL; Tile::SoundType *Tile::SOUND_GRAVEL = NULL; -Tile::SoundType *Tile::SOUND_GRASS = NULL; +Tile::SoundType *Tile::SOUND_GRASS = NULL; Tile::SoundType *Tile::SOUND_STONE = NULL; Tile::SoundType *Tile::SOUND_METAL = NULL; Tile::SoundType *Tile::SOUND_GLASS = NULL; @@ -185,7 +185,7 @@ Tile *Tile::enderChest = NULL; TripWireSourceTile *Tile::tripWireSource = NULL; Tile *Tile::tripWire = NULL; Tile *Tile::emeraldBlock = NULL; - + Tile *Tile::cocoa = NULL; Tile *Tile::skull = NULL; @@ -273,7 +273,7 @@ void Tile::staticCtor() Tile::sponge = (new Sponge(19)) ->setDestroyTime(0.6f)->setSoundType(Tile::SOUND_GRASS)->setTextureName(L"sponge")->setDescriptionId(IDS_TILE_SPONGE)->setUseDescriptionId(IDS_DESC_SPONGE); Tile::glass = (new GlassTile(20, Material::glass, false)) ->setDestroyTime(0.3f)->setSoundType(Tile::SOUND_GLASS)->setTextureName(L"glass")->setDescriptionId(IDS_TILE_GLASS)->setUseDescriptionId(IDS_DESC_GLASS); Tile::dispenser = (new DispenserTile(23)) ->setDestroyTime(3.5f)->setSoundType(Tile::SOUND_STONE)->setTextureName(L"dispenser")->setDescriptionId(IDS_TILE_DISPENSER)->sendTileData()->setUseDescriptionId(IDS_DESC_DISPENSER); - + //Tile::wood = (new Tile(5, 4, Material::wood)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structwoodstuff, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(Tile::SOUND_WOOD)->setDescriptionId(IDS_TILE_WOOD)->sendTileData()->setUseDescriptionId(IDS_DESC_WOODENPLANKS); Tile::wood = (new WoodTile(5)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structwoodstuff, Item::eMaterial_wood)->setDestroyTime(2.0f)->setExplodeable(5)->setSoundType(Tile::SOUND_WOOD)->setTextureName(L"wood")->setDescriptionId(IDS_TILE_OAKWOOD_PLANKS)->sendTileData()->setUseDescriptionId(IDS_DESC_WOODENPLANKS); Tile::sandStone = (new SandStoneTile(24)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_sand)->setSoundType(Tile::SOUND_STONE)->setDestroyTime(0.8f)->sendTileData()->setTextureName(L"sandStone")->setDescriptionId(IDS_TILE_SANDSTONE)->setUseDescriptionId(IDS_DESC_SANDSTONE)->sendTileData(); @@ -281,7 +281,7 @@ void Tile::staticCtor() Tile::redBrick = (new Tile(45, Material::stone)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_brick)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setTextureName(L"brick")->setDescriptionId(IDS_TILE_BRICK)->setUseDescriptionId(IDS_DESC_BRICK); Tile::clay = (new ClayTile(82)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_clay)->setDestroyTime(0.6f)->setSoundType(Tile::SOUND_GRAVEL)->setTextureName(L"clay")->setDescriptionId(IDS_TILE_CLAY)->setUseDescriptionId(IDS_DESC_CLAY_TILE); Tile::snow = (new SnowTile(80)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_structblock, Item::eMaterial_snow)->setDestroyTime(0.2f)->setSoundType(Tile::SOUND_CLOTH)->setTextureName(L"snow")->setDescriptionId(IDS_TILE_SNOW)->setUseDescriptionId(IDS_DESC_SNOW); - + Tile::torch = (new TorchTile(50)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_torch, Item::eMaterial_wood)->setDestroyTime(0.0f)->setLightEmission(15 / 16.0f)->setSoundType(Tile::SOUND_WOOD)->setTextureName(L"torch")->setDescriptionId(IDS_TILE_TORCH)->sendTileData()->setUseDescriptionId(IDS_DESC_TORCH)->disableMipmap(); Tile::litPumpkin = (new PumpkinTile(91, true)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_torch, Item::eMaterial_pumpkin)->setDestroyTime(1.0f)->setSoundType(Tile::SOUND_WOOD)->setLightEmission(1.0f)->setTextureName(L"litpumpkin")->setDescriptionId(IDS_TILE_LIT_PUMPKIN)->sendTileData()->setUseDescriptionId(IDS_DESC_JACKOLANTERN); Tile::lightGem = (new LightGemTile(89, Material::glass)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_torch, Item::eMaterial_glowstone)->setDestroyTime(0.3f)->setSoundType(Tile::SOUND_GLASS)->setLightEmission(1.0f)->setTextureName(L"lightgem")->setDescriptionId(IDS_TILE_LIGHT_GEM)->setUseDescriptionId(IDS_DESC_GLOWSTONE); @@ -310,17 +310,17 @@ void Tile::staticCtor() // Tile::stoneSlab = (new StoneSlabTile(43, true)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_slab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_SLAB); // Tile::stoneSlabHalf = (new StoneSlabTile(44, false)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_halfslab, Item::eMaterial_stone)->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setDescriptionId(IDS_TILE_STONESLAB)->setUseDescriptionId(IDS_DESC_HALFSLAB); - + Tile::tnt = (new TntTile(46)) ->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_GRASS)->setTextureName(L"tnt")->setDescriptionId(IDS_TILE_TNT)->setUseDescriptionId(IDS_DESC_TNT); Tile::bookshelf = (new BookshelfTile(47)) ->setDestroyTime(1.5f)->setSoundType(Tile::SOUND_WOOD)->setTextureName(L"bookshelf")->setDescriptionId(IDS_TILE_BOOKSHELF)->setUseDescriptionId(IDS_DESC_BOOKSHELF); Tile::mossStone = (new Tile(48, Material::stone)) ->setDestroyTime(2.0f)->setExplodeable(10)->setSoundType(Tile::SOUND_STONE)->setTextureName(L"stoneMoss")->setDescriptionId(IDS_TILE_STONE_MOSS)->setUseDescriptionId(IDS_DESC_MOSS_STONE); // 4J - change of destroy time from 10.0f -> 50.0f for obsidian brought forward from 1.2.3 Tile::obsidian = (new ObsidianTile(49)) ->setDestroyTime(50.0f)->setExplodeable(2000)->setSoundType(Tile::SOUND_STONE)->setTextureName(L"obsidian")->setDescriptionId(IDS_TILE_OBSIDIAN)->setUseDescriptionId(IDS_DESC_OBSIDIAN); - + Tile::fire = (FireTile *) ((new FireTile(51)) ->setDestroyTime(0.0f)->setLightEmission(1.0f)->setSoundType(Tile::SOUND_WOOD))->setTextureName(L"fire")->setDescriptionId(IDS_TILE_FIRE)->setNotCollectStatistics()->setUseDescriptionId(-1); Tile::mobSpawner = (new MobSpawnerTile(52)) ->setDestroyTime(5.0f)->setSoundType(Tile::SOUND_METAL)->setTextureName(L"mobSpawner")->setDescriptionId(IDS_TILE_MOB_SPAWNER)->setNotCollectStatistics()->setUseDescriptionId(IDS_DESC_MOB_SPAWNER); - + Tile::chest = (ChestTile *)(new ChestTile(54)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_chest, Item::eMaterial_ender)->setDestroyTime(2.5f)->setSoundType(Tile::SOUND_WOOD)->setTextureName(L"chest")->setDescriptionId(IDS_TILE_CHEST)->sendTileData()->setUseDescriptionId(IDS_DESC_CHEST); Tile::redStoneDust = (RedStoneDustTile *)(new RedStoneDustTile(55)) ->setDestroyTime(0.0f)->setSoundType(Tile::SOUND_NORMAL)->setTextureName(L"redstoneDust")->setDescriptionId(IDS_TILE_REDSTONE_DUST)->setNotCollectStatistics()->sendTileData()->setUseDescriptionId(IDS_DESC_REDSTONE_DUST); Tile::workBench = (new WorkbenchTile(58)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_device, Item::eMaterial_wood)->setDestroyTime(2.5f)->setSoundType(Tile::SOUND_WOOD)->setTextureName(L"workbench")->setDescriptionId(IDS_TILE_WORKBENCH)->setUseDescriptionId(IDS_DESC_CRAFTINGTABLE); @@ -409,7 +409,7 @@ void Tile::staticCtor() Tile::tripWireSource = (TripWireSourceTile *)( new TripWireSourceTile(131) ) ->setTextureName(L"tripWireSource")->sendTileData()->setDescriptionId(IDS_TILE_TRIPWIRE_SOURCE)->setUseDescriptionId(IDS_DESC_TRIPWIRE_SOURCE); Tile::tripWire = (new TripWireTile(132)) ->setTextureName(L"tripWire")->sendTileData()->setDescriptionId(IDS_TILE_TRIPWIRE)->setUseDescriptionId(IDS_DESC_TRIPWIRE); Tile::emeraldBlock = (new MetalTile(133)) ->setBaseItemTypeAndMaterial(Item::eBaseItemType_block, Item::eMaterial_emerald)->setDestroyTime(5.0f)->setExplodeable(10)->setSoundType(SOUND_METAL)->setTextureName(L"blockEmerald")->setDescriptionId(IDS_TILE_EMERALDBLOCK)->setUseDescriptionId(IDS_DESC_EMERALDBLOCK); - + Tile::cocoa = (new CocoaTile(127)) ->setDestroyTime(0.2f)->setExplodeable(5)->setSoundType(SOUND_WOOD)->setTextureName(L"cocoa")->sendTileData()->setDescriptionId(IDS_TILE_COCOA)->setUseDescriptionId(IDS_DESC_COCOA); Tile::skull = (new SkullTile(144)) ->setDestroyTime(1.0f)->setSoundType(SOUND_STONE)->setTextureName(L"skull")->setDescriptionId(IDS_TILE_SKULL)->setUseDescriptionId(IDS_DESC_SKULL); @@ -658,7 +658,7 @@ void Tile::setShape(float x0, float y0, float z0, float x1, float y1, float z1) tls->yy1 = y1; tls->zz1 = z1; tls->tileId = this->id; - + //this->xx0 = x0; //this->yy0 = y0; //this->zz0 = z0; @@ -798,7 +798,7 @@ AABB *Tile::getTileAABB(Level *level, int x, int y, int z) return AABB::newTemp(x + tls->xx0, y + tls->yy0, z + tls->zz0, x + tls->xx1, y + tls->yy1, z + tls->zz1); } -void Tile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) +void Tile::addAABBs(Level *level, int x, int y, int z, AABB *box, AABBList *boxes, shared_ptr source) { AABB *aabb = getAABB(level, x, y, z); if (aabb != NULL && box->intersects(aabb)) boxes->push_back(aabb); @@ -977,7 +977,7 @@ HitResult *Tile::clip(Level *level, int xt, int yt, int zt, Vec3 *a, Vec3 *b) bool Tile::containsX(Vec3 *v) { if( v == NULL) return false; - + ThreadStorage *tls = (ThreadStorage *)TlsGetValue(Tile::tlsIdxShape); // 4J Stu - Added this so that the TLS shape is correct for this tile if(tls->tileId != this->id) updateDefaultShape(); @@ -1333,7 +1333,7 @@ void Tile::handleRain(Level *level, int x, int y, int z) { } - void Tile::levelTimeChanged(Level *level, __int64 delta, __int64 newTime) + void Tile::levelTimeChanged(Level *level, int64_t delta, int64_t newTime) { } @@ -1454,26 +1454,26 @@ Tile::SoundType::SoundType(eMATERIALSOUND_TYPE eMaterialSound, float volume, flo } float Tile::SoundType::getVolume() const -{ - return volume; +{ + return volume; } float Tile::SoundType::getPitch() const -{ - return pitch; +{ + return pitch; } //wstring getBreakSound() const { return breakSound; } //wstring getStepSound() const { return stepSound; } int Tile::SoundType::getBreakSound() const -{ - return iBreakSound; +{ + return iBreakSound; } int Tile::SoundType::getStepSound() const -{ - return iStepSound; +{ + return iStepSound; } int Tile::SoundType::getPlaceSound() const -{ - return iPlaceSound; +{ + return iPlaceSound; } diff --git a/Minecraft.World/Tile.h b/Minecraft.World/Tile.h index fa2f5786..fb17f917 100644 --- a/Minecraft.World/Tile.h +++ b/Minecraft.World/Tile.h @@ -56,13 +56,13 @@ protected: ThreadStorage(); }; static DWORD tlsIdxShape; -public: +public: // Each new thread that needs to use Vec3 pools will need to call one of the following 2 functions, to either create its own // local storage, or share the default storage already allocated by the main thread static void CreateNewThreadStorage(); static void ReleaseThreadStorage(); -public: +public: static const int TILE_NUM_COUNT = 4096; static const int TILE_NUM_MASK = 0xfff; // 4096 - 1 static const int TILE_NUM_SHIFT = 12; // 4096 is 12 bits @@ -87,7 +87,7 @@ public: float pitch; SoundType(eMATERIALSOUND_TYPE eMaterialSound, float volume, float pitch, int iBreakSound = -1, int iPlaceSound = -1); - + float getVolume() const; float getPitch() const; //wstring getBreakSound() const { return breakSound; } @@ -100,7 +100,7 @@ public: static SoundType *SOUND_NORMAL; static SoundType *SOUND_WOOD; static SoundType *SOUND_GRAVEL; - static SoundType *SOUND_GRASS; + static SoundType *SOUND_GRASS; static SoundType *SOUND_STONE; static SoundType *SOUND_METAL; static SoundType *SOUND_GLASS; @@ -287,7 +287,7 @@ public: static const int redstoneLight_Id = 123; static const int redstoneLight_lit_Id = 124; - + static const int woodSlab_Id = 125; static const int woodSlabHalf_Id = 126; static const int cocoa_Id = 127; @@ -456,7 +456,7 @@ public: static TripWireSourceTile *tripWireSource; static Tile *tripWire; static Tile *emeraldBlock; - + static Tile *cocoa; static Tile *skull; @@ -464,7 +464,7 @@ public: static Tile *flowerPot; static Tile *carrots; static Tile *potatoes; - static Tile *anvil; + static Tile *anvil; static Tile *netherQuartz; static Tile *quartzBlock; static Tile *stairs_quartz; @@ -636,9 +636,9 @@ public: virtual void playerWillDestroy(Level *level, int x, int y, int z, int data, shared_ptr player); virtual void onRemoving(Level *level, int x, int y, int z, int data); virtual void handleRain(Level *level, int x, int y, int z); - virtual void levelTimeChanged(Level *level, __int64 delta, __int64 newTime); + virtual void levelTimeChanged(Level *level, int64_t delta, int64_t newTime); virtual void registerIcons(IconRegister *iconRegister); - virtual wstring getTileItemIconName(); + virtual wstring getTileItemIconName(); // 4J Using per-item textures now Tile *setTextureName(const wstring &name); // AP - added this function so we can generate the faceFlags for a block in a single fast function diff --git a/Minecraft.World/VoronoiZoom.cpp b/Minecraft.World/VoronoiZoom.cpp index 78323dfa..f62cc9b6 100644 --- a/Minecraft.World/VoronoiZoom.cpp +++ b/Minecraft.World/VoronoiZoom.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -VoronoiZoom::VoronoiZoom(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +VoronoiZoom::VoronoiZoom(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } diff --git a/Minecraft.World/VoronoiZoom.h b/Minecraft.World/VoronoiZoom.h index c0738c90..43a8de66 100644 --- a/Minecraft.World/VoronoiZoom.h +++ b/Minecraft.World/VoronoiZoom.h @@ -5,7 +5,7 @@ class VoronoiZoom : public Layer { public: - VoronoiZoom(__int64 seedMixup, shared_ptrparent); + VoronoiZoom(int64_t seedMixup, shared_ptrparent); virtual intArray getArea(int xo, int yo, int w, int h); diff --git a/Minecraft.World/WaterLevelChunk.cpp b/Minecraft.World/WaterLevelChunk.cpp index b6dbd05d..19f3e8a1 100644 --- a/Minecraft.World/WaterLevelChunk.cpp +++ b/Minecraft.World/WaterLevelChunk.cpp @@ -143,7 +143,7 @@ bool WaterLevelChunk::testSetBlocksAndData(byteArray data, int x0, int y0, int z return false; } -Random *WaterLevelChunk::getRandom(__int64 l) +Random *WaterLevelChunk::getRandom(int64_t l) { return new Random((level->getSeed() + x * x * 4987142 + x * 5947611 + z * z * 4392871l + z * 389711) ^ l); } diff --git a/Minecraft.World/WaterLevelChunk.h b/Minecraft.World/WaterLevelChunk.h index 18dc8a05..43e7e0c6 100644 --- a/Minecraft.World/WaterLevelChunk.h +++ b/Minecraft.World/WaterLevelChunk.h @@ -39,7 +39,7 @@ public: void setBlocks(byteArray newBlocks, int sub); int setBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p, bool includeLighting = true); // 4J - added includeLighting parameter; bool testSetBlocksAndData(byteArray data, int x0, int y0, int z0, int x1, int y1, int z1, int p); - Random *getRandom(__int64 l); + Random *getRandom(int64_t l); virtual Biome *getBiome(int x, int z, BiomeSource *biomeSource); virtual void reSyncLighting() {}; // 4J added }; diff --git a/Minecraft.World/ZoneFile.cpp b/Minecraft.World/ZoneFile.cpp index fc1f36bf..661cb7dd 100644 --- a/Minecraft.World/ZoneFile.cpp +++ b/Minecraft.World/ZoneFile.cpp @@ -6,7 +6,7 @@ const int ZoneFile::slotsLength = ZonedChunkStorage::CHUNKS_PER_ZONE * ZonedChunkStorage::CHUNKS_PER_ZONE; -ZoneFile::ZoneFile(__int64 key, File file, File entityFile) : slots(slotsLength) +ZoneFile::ZoneFile(int64_t key, File file, File entityFile) : slots(slotsLength) { lastUse = 0; diff --git a/Minecraft.World/ZoneFile.h b/Minecraft.World/ZoneFile.h index d7b8cc82..5adb60ee 100644 --- a/Minecraft.World/ZoneFile.h +++ b/Minecraft.World/ZoneFile.h @@ -17,18 +17,18 @@ private: short slotCount; public: - __int64 lastUse; + int64_t lastUse; private: HANDLE channel; public: - __int64 key; + int64_t key; File file; NbtSlotFile *entityFile; - ZoneFile(__int64 key, File file, File entityFile); + ZoneFile(int64_t key, File file, File entityFile); ~ZoneFile(); void readHeader(); diff --git a/Minecraft.World/ZoneIo.cpp b/Minecraft.World/ZoneIo.cpp index f1838c86..0bd2a637 100644 --- a/Minecraft.World/ZoneIo.cpp +++ b/Minecraft.World/ZoneIo.cpp @@ -2,7 +2,7 @@ #include "ByteBuffer.h" #include "ZoneIo.h" -ZoneIo::ZoneIo(HANDLE channel, __int64 pos) +ZoneIo::ZoneIo(HANDLE channel, int64_t pos) { this->channel = channel; this->pos = pos; diff --git a/Minecraft.World/ZoneIo.h b/Minecraft.World/ZoneIo.h index 22473583..59840564 100644 --- a/Minecraft.World/ZoneIo.h +++ b/Minecraft.World/ZoneIo.h @@ -7,10 +7,10 @@ class ZoneIo { private: HANDLE channel; - __int64 pos; + int64_t pos; public: - ZoneIo(HANDLE channel, __int64 pos); + ZoneIo(HANDLE channel, int64_t pos); void write(byteArray bb, int size); void write(ByteBuffer *bb, int size); ByteBuffer *read(int size); diff --git a/Minecraft.World/ZonedChunkStorage.cpp b/Minecraft.World/ZonedChunkStorage.cpp index b4ee8585..aed408c6 100644 --- a/Minecraft.World/ZonedChunkStorage.cpp +++ b/Minecraft.World/ZonedChunkStorage.cpp @@ -11,7 +11,7 @@ // 4J Stu - There are changes to this class for 1.8.2, but since we never use it anyway lets not worry about it const int ZonedChunkStorage::BIT_TERRAIN_POPULATED = 0x0000001; - + const int ZonedChunkStorage::CHUNKS_PER_ZONE_BITS = 5; // = 32 const int ZonedChunkStorage::CHUNKS_PER_ZONE = 1 << ZonedChunkStorage::CHUNKS_PER_ZONE_BITS; // ^2 @@ -50,7 +50,7 @@ ZoneFile *ZonedChunkStorage::getZoneFile(int x, int z, bool create) int xZone = x >> CHUNKS_PER_ZONE_BITS; int zZone = z >> CHUNKS_PER_ZONE_BITS; - __int64 key = xZone + (zZone << 20l); + int64_t key = xZone + (zZone << 20l); // 4J - was !zoneFiles.containsKey(key) if (zoneFiles.find(key) == zoneFiles.end()) { @@ -107,8 +107,8 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) header->flip(); int xOrg = header->getInt(); int zOrg = header->getInt(); - __int64 time = header->getLong(); - __int64 flags = header->getLong(); + int64_t time = header->getLong(); + int64_t flags = header->getLong(); lc->terrainPopulated = (flags & BIT_TERRAIN_POPULATED) != 0; @@ -121,7 +121,7 @@ LevelChunk *ZonedChunkStorage::load(Level *level, int x, int z) void ZonedChunkStorage::save(Level *level, LevelChunk *lc) { - __int64 flags = 0; + int64_t flags = 0; if (lc->terrainPopulated) flags |= BIT_TERRAIN_POPULATED; ByteBuffer *header = ByteBuffer::allocate(CHUNK_HEADER_SIZE); @@ -147,10 +147,10 @@ void ZonedChunkStorage::tick() tickCount++; if (tickCount % (20 * 10) == 4) { - vector<__int64> toClose; + vector toClose; AUTO_VAR(itEndZF, zoneFiles.end()); - for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEndZF; it++ ) + for( unordered_map::iterator it = zoneFiles.begin(); it != itEndZF; it++ ) { ZoneFile *zoneFile = it->second; if (tickCount - zoneFile->lastUse > 20 * 60) @@ -158,11 +158,11 @@ void ZonedChunkStorage::tick() toClose.push_back(zoneFile->key); } } - + AUTO_VAR(itEndTC, toClose.end()); for (AUTO_VAR(it, toClose.begin()); it != itEndTC; it++) { - __int64 key = *it ; //toClose[i]; + int64_t key = *it ; //toClose[i]; // 4J - removed try/catch // try { char buf[256]; @@ -181,7 +181,7 @@ void ZonedChunkStorage::tick() void ZonedChunkStorage::flush() { AUTO_VAR(itEnd, zoneFiles.end()); - for( unordered_map<__int64, ZoneFile *>::iterator it = zoneFiles.begin(); it != itEnd; it++ ) + for( unordered_map::iterator it = zoneFiles.begin(); it != itEnd; it++ ) { ZoneFile *zoneFile = it->second; // 4J - removed try/catch diff --git a/Minecraft.World/ZonedChunkStorage.h b/Minecraft.World/ZonedChunkStorage.h index ed7e3b65..c8b89db9 100644 --- a/Minecraft.World/ZonedChunkStorage.h +++ b/Minecraft.World/ZonedChunkStorage.h @@ -14,24 +14,24 @@ class ZonedChunkStorage : public ChunkStorage { public: static const int BIT_TERRAIN_POPULATED; - + static const int CHUNKS_PER_ZONE_BITS; // = 32 static const int CHUNKS_PER_ZONE; // ^2 - + static const int CHUNK_WIDTH; - + static const int CHUNK_HEADER_SIZE; static const int CHUNK_SIZE; static const int CHUNK_LAYERS ; static const int CHUNK_SIZE_BYTES; - + static const ByteOrder BYTEORDER; File dir; private: - unordered_map<__int64, ZoneFile *> zoneFiles; - __int64 tickCount; + unordered_map zoneFiles; + int64_t tickCount; public: ZonedChunkStorage(File dir); diff --git a/Minecraft.World/ZoomLayer.cpp b/Minecraft.World/ZoomLayer.cpp index bef24709..c2123785 100644 --- a/Minecraft.World/ZoomLayer.cpp +++ b/Minecraft.World/ZoomLayer.cpp @@ -2,7 +2,7 @@ #include "net.minecraft.world.level.newbiome.layer.h" #include "System.h" -ZoomLayer::ZoomLayer(__int64 seedMixup, shared_ptrparent) : Layer(seedMixup) +ZoomLayer::ZoomLayer(int64_t seedMixup, shared_ptrparent) : Layer(seedMixup) { this->parent = parent; } @@ -81,7 +81,7 @@ int ZoomLayer::random(int a, int b, int c, int d) return d; } -shared_ptrZoomLayer::zoom(__int64 seed, shared_ptr sup, int count) +shared_ptrZoomLayer::zoom(int64_t seed, shared_ptr sup, int count) { shared_ptrresult = sup; for (int i = 0; i < count; i++) diff --git a/Minecraft.World/ZoomLayer.h b/Minecraft.World/ZoomLayer.h index f865f088..8ec93c8a 100644 --- a/Minecraft.World/ZoomLayer.h +++ b/Minecraft.World/ZoomLayer.h @@ -5,7 +5,7 @@ class ZoomLayer : public Layer { public: - ZoomLayer(__int64 seedMixup, shared_ptr parent); + ZoomLayer(int64_t seedMixup, shared_ptr parent); virtual intArray getArea(int xo, int yo, int w, int h); @@ -14,5 +14,5 @@ protected: int random(int a, int b, int c, int d); public: - static shared_ptr zoom(__int64 seed, shared_ptrsup, int count); + static shared_ptr zoom(int64_t seed, shared_ptrsup, int count); }; \ No newline at end of file diff --git a/Minecraft.World/stdafx.h b/Minecraft.World/stdafx.h index 614f997b..065cd097 100644 --- a/Minecraft.World/stdafx.h +++ b/Minecraft.World/stdafx.h @@ -9,9 +9,7 @@ #define AUTO_VAR(_var, _val) auto _var = _val #endif -#if ( defined _XBOX || defined _WINDOWS64 || defined _DURANGO ) -typedef unsigned __int64 __uint64; -#endif +#include #ifdef _WINDOWS64 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers diff --git a/Minecraft.World/system.cpp b/Minecraft.World/system.cpp index 72727e20..69039921 100644 --- a/Minecraft.World/system.cpp +++ b/Minecraft.World/system.cpp @@ -21,7 +21,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWith assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); assert( dstPos + length <= dst->length ); - + memcpy( dst->data + dstPos, src.data + srcPos, length); } @@ -30,7 +30,7 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithL assert( srcPos >=0 && srcPos <= src.length); assert( srcPos + length <= src.length ); assert( dstPos + length <= dst->length ); - + memcpy( dst->data + dstPos, src.data + srcPos, length * sizeof(int) ); } @@ -47,10 +47,10 @@ void System::arraycopy(arrayWithLength src, unsigned int srcPos, arrayWithL // long startTime = System.nanoTime(); // // ... the code being measured ... // long estimatedTime = System.nanoTime() - startTime; -// +// //Returns: //The current value of the system timer, in nanoseconds. -__int64 System::nanoTime() +int64_t System::nanoTime() { return GetTickCount() * 1000000LL; } @@ -58,21 +58,21 @@ __int64 System::nanoTime() //Returns the current time in milliseconds. Note that while the unit of time of the return value is a millisecond, //the granularity of the value depends on the underlying operating system and may be larger. For example, //many operating systems measure time in units of tens of milliseconds. -//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" +//See the description of the class Date for a discussion of slight discrepancies that may arise between "computer time" //and coordinated universal time (UTC). // //Returns: //the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC. -__int64 System::currentTimeMillis() +int64_t System::currentTimeMillis() { #ifdef __PS3__ -// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC). -// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec +// sys_time_get_current_time() obtains the elapsed time since Epoch (1970/01/01 00:00:00 UTC). +// The value is separated into two parts: sec stores the elapsed time in seconds, and nsec // stores the value that is smaller than a second in nanoseconds. sys_time_sec_t sec; sys_time_nsec_t nsec; sys_time_get_current_time(&sec, &nsec); - __int64 msec = (sec * 1000) + (nsec / (1000*1000)); + int64_t msec = (sec * 1000) + (nsec / (1000*1000)); return msec; #elif defined __ORBIS__ @@ -85,7 +85,7 @@ __int64 System::currentTimeMillis() return sceKernelGetProcessTimeWide() / 1000; /* SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime;*/ #else @@ -106,12 +106,12 @@ __int64 System::currentTimeMillis() } // 4J Stu - Added this so that we can use real-world timestamps in PSVita saves. Particularly required for the save transfers to be smooth -__int64 System::currentRealTimeMillis() +int64_t System::currentRealTimeMillis() { #ifdef __PSVITA__ SceDateTime Time; sceRtcGetCurrentClockLocalTime(&Time); - __int64 systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); + int64_t systTime = (((((((Time.day * 24) + Time.hour) * 60) + Time.minute) * 60) + Time.second) * 1000) + (Time.microsecond / 1000); return systTime; #else return currentTimeMillis(); @@ -175,9 +175,9 @@ void System::ReverseINT(int *piVal) pchVal1[3]=pchVal2[0]; } -void System::ReverseULONGLONG(__int64 *pullVal) +void System::ReverseULONGLONG(int64_t *pullVal) { - __int64 ullValue=*pullVal; + int64_t ullValue=*pullVal; unsigned char *pchVal1=(unsigned char *)pullVal; unsigned char *pchVal2=(unsigned char *)&ullValue;