Remove all MSVC __int64 (#742)

This commit is contained in:
void_17
2026-03-07 03:31:30 +07:00
committed by GitHub
parent 175fc3824e
commit 988e3042e0
277 changed files with 3672 additions and 3684 deletions

View File

@@ -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;i<m_iTexturePacksNotInstalled;i++)
{
if(m_iConfigA[i]!=-1)
if(m_iConfigA[i]!=-1)
{
bAllDone = false;
}
@@ -756,7 +756,7 @@ int CScene_MultiGameCreate::ConfirmCreateReturned(void *pParam,int iPad,C4JStora
{
CScene_MultiGameCreate* pClass = (CScene_MultiGameCreate*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
if(result==C4JStorage::EMessage_ResultAccept)
{
bool isClientSide = ProfileManager.IsSignedInLive(ProfileManager.GetPrimaryPad()) && pClass->m_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<int64_t>(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;

View File

@@ -1945,7 +1945,7 @@ 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);

View File

@@ -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);
}