diff --git a/Minecraft.Client/AbstractTexturePack.cpp b/Minecraft.Client/AbstractTexturePack.cpp index 91df466a..317acf65 100644 --- a/Minecraft.Client/AbstractTexturePack.cpp +++ b/Minecraft.Client/AbstractTexturePack.cpp @@ -248,7 +248,7 @@ void AbstractTexturePack::loadDefaultUI() //CXuiSceneBase::GetInstance()->SetVisualPrefix(L"TexturePack"); CXuiSceneBase::GetInstance()->SkinChanged(CXuiSceneBase::GetInstance()->m_hObj); #else - ui.ReloadSkin(); + ui.ReloadSkins(); #endif } diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index b912ecea..f92517e3 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -4039,8 +4039,8 @@ void CMinecraftApp::HandleXuiActions(void) ui.SetTooltips(i, -1); - ui.ReloadSkin(); - ui.StartReloadSkinThread(); + ui.ReloadSkins(); + ui.StartReloadSkinsThread(); ui.setCleanupOnReload(); #endif diff --git a/Minecraft.Client/Common/Network/GameNetworkManager.cpp b/Minecraft.Client/Common/Network/GameNetworkManager.cpp index d4b2e383..b9ed927b 100644 --- a/Minecraft.Client/Common/Network/GameNetworkManager.cpp +++ b/Minecraft.Client/Common/Network/GameNetworkManager.cpp @@ -418,8 +418,8 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame // 4J Stu - We were ticking this way too fast which could cause the connection to time out // The connections should tick at 20 per second Sleep(50); - } while ( (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame()) || tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) ); - ui.CleanUpSkinReload(); + } while ( (IsInSession() && !connection->isStarted() && !connection->isClosed() && !g_NetworkManager.IsLeavingGame()) || tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) ); + ui.CleanUpSkinsReload(); // 4J Stu - Fix for #11279 - CRASH: TCR 001: BAS Game Stability: Signing out of game will cause title to crash // We need to break out of the above loop if m_bLeavingGame is set, and close the connection @@ -900,11 +900,11 @@ int CGameNetworkManager::RunNetworkGameThreadProc( void* lpParameter ) if( !success) { TexturePack *tPack = Minecraft::GetInstance()->skins->getSelected(); - while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) ) + while ( tPack->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) ) { Sleep(1); } - ui.CleanUpSkinReload(); + ui.CleanUpSkinsReload(); if(app.GetDisconnectReason() == DisconnectPacket::eDisconnect_None) { app.SetDisconnectReason( DisconnectPacket::eDisconnect_ConnectionCreationFailed ); @@ -937,7 +937,7 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter ) // 4J Stu - If we are loading a DLC save that's separate from the texture pack, load if( param->levelGen != NULL && (param->texturePackId == 0 || param->levelGen->getRequiredTexturePackId() != param->texturePackId) ) { - while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin())) + while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins())) { Sleep(1); } diff --git a/Minecraft.Client/Common/UI/IUIController.h b/Minecraft.Client/Common/UI/IUIController.h index 8adfba1c..125acebb 100644 --- a/Minecraft.Client/Common/UI/IUIController.h +++ b/Minecraft.Client/Common/UI/IUIController.h @@ -9,9 +9,9 @@ class IUIController public: virtual void tick() = 0; virtual void render() = 0; - virtual void StartReloadSkinThread() = 0; - virtual bool IsReloadingSkin() = 0; - virtual void CleanUpSkinReload() = 0; + virtual void StartReloadSkinsThread() = 0; + virtual bool IsReloadingSkins() = 0; + virtual void CleanUpSkinsReload() = 0; virtual bool NavigateToScene(int iPad, EUIScene scene, void *initData = NULL, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD) = 0; virtual bool NavigateBack(int iPad, bool forceUsePad = false, EUIScene eScene = eUIScene_COUNT, EUILayer eLayer = eUILayer_COUNT) = 0; virtual void CloseUIScenes(int iPad, bool forceIPad = false) = 0; diff --git a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp index fab15ff5..5746daae 100644 --- a/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_PressStartToPlay.cpp @@ -82,7 +82,7 @@ void UIComponent_PressStartToPlay::handleTimerComplete(int id) void UIComponent_PressStartToPlay::showPressStart(int iPad, bool show) { m_showingPressStart[iPad] = show; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_controlPressStartPanel.setVisible(show); @@ -103,7 +103,7 @@ void UIComponent_PressStartToPlay::showPressStart(int iPad, bool show) void UIComponent_PressStartToPlay::setTrialTimer(const wstring &label) { m_trialTimer = label; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_labelTrialTimer.setLabel(label); } @@ -112,7 +112,7 @@ void UIComponent_PressStartToPlay::setTrialTimer(const wstring &label) void UIComponent_PressStartToPlay::showTrialTimer(bool show) { m_showingTrialTimer = show; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_labelTrialTimer.setVisible(show); } @@ -121,7 +121,7 @@ void UIComponent_PressStartToPlay::showTrialTimer(bool show) void UIComponent_PressStartToPlay::setAutosaveTimer(const wstring &label) { m_autosaveTimer = label; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_labelTrialTimer.setLabel(label); } @@ -130,7 +130,7 @@ void UIComponent_PressStartToPlay::setAutosaveTimer(const wstring &label) void UIComponent_PressStartToPlay::showAutosaveTimer(bool show) { m_showingAutosaveTimer = show; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_labelTrialTimer.setVisible(show); } @@ -139,7 +139,7 @@ void UIComponent_PressStartToPlay::showAutosaveTimer(bool show) void UIComponent_PressStartToPlay::showSaveIcon(bool show) { m_showingSaveIcon = show; - if(!ui.IsExpectingOrReloadingSkin() && hasMovie()) + if(!ui.IsExpectingOrReloadingSkins() && hasMovie()) { m_controlSaveIcon.setVisible(show); } diff --git a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp index f933fbb8..5841dce7 100644 --- a/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp +++ b/Minecraft.Client/Common/UI/UIComponent_Tooltips.cpp @@ -181,7 +181,7 @@ void UIComponent_Tooltips::tick() bool layoutChanges = false; for (int i = 0; i < eToolTipNumButtons; i++) { - if ( !ui.IsReloadingSkin() && m_tooltipValues[i].show && m_tooltipValues[i].label.needsUpdating() ) + if ( !ui.IsReloadingSkins() && m_tooltipValues[i].show && m_tooltipValues[i].label.needsUpdating() ) { layoutChanges = true; _SetTooltip(i, m_tooltipValues[i].label, m_tooltipValues[i].show, true); diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index dee0d554..18b99d7e 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -15,7 +15,6 @@ #include #elif _WINDOWS64 #include "Windows64\Windows64_Minecraft.h" -string m_LastControllerType = "mrow"; #endif // 4J Stu - Enable this to override the Iggy Allocator @@ -50,8 +49,12 @@ string m_LastControllerType = "mrow"; #endif -CRITICAL_SECTION UIController::ms_reloadSkinCS; -bool UIController::ms_bReloadSkinCSInitialised = false; +#ifdef _WINDOWS64 +string m_LastControllerType = "mrow"; +#endif + +CRITICAL_SECTION UIController::ms_reloadSkinsCS; +bool UIController::ms_bReloadSkinsCSInitialised = false; DWORD UIController::m_dwTrialTimerLimitSecs=DYNAMIC_CONFIG_DEFAULT_TRIAL_TIME; @@ -165,7 +168,7 @@ static void RADLINK DeallocateFunction ( void * alloc_callback_user_data , void UIController::UIController() { m_uiDebugConsole = NULL; - m_reloadSkinThread = NULL; + m_reloadSkinsThread = NULL; m_navigateToHomeOnReload = false; @@ -230,11 +233,11 @@ UIController::UIController() m_bTouchscreenPressed=false; #endif - if(!ms_bReloadSkinCSInitialised) + if(!ms_bReloadSkinsCSInitialised) { // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded - InitializeCriticalSection(&ms_reloadSkinCS); - ms_bReloadSkinCSInitialised = true; + InitializeCriticalSection(&ms_reloadSkinsCS); + ms_bReloadSkinsCSInitialised = true; } } @@ -336,13 +339,13 @@ UITTFFont *UIController::createFont(EFont fontLanguage) { switch(fontLanguage) { -#if defined(__PS3__) || defined(__ORBIS__) || defined(__PSVITA__) +#if !(defined _DURANGO || _WINDOWS64) case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DF-DotDotGothic16.ttf", 0x203B); // JPN case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFTT_R5.TTC", 0x203B); // CHT case eFont_Korean: return new UITTFFont("Mojangles_TTF_koKR", "Common/Media/font/KOR/candadite2.ttf", 0x203B); // KOR #else case eFont_Japanese: return new UITTFFont("Mojangles_TTF_jaJP", "Common/Media/font/JPN/DFGMaruGothic-Md.ttf", 0x2022); // JPN -#if defined(_DURANGO) || defined(_WINDOWS64) +#if (defined _DURANGO || _WINDOWS64) case eFont_SimpChinese: return new UITTFFont("Mojangled_TTF_cnCN", "Common/Media/font/CHS/MSYH.ttf", 0x2022); // CHS #endif case eFont_TradChinese: return new UITTFFont("Mojangles_TTF_cnTD", "Common/Media/font/CHT/DFHeiMedium-B5.ttf", 0x2022); // CHT @@ -442,9 +445,9 @@ void UIController::tick() { SetupFont(); // If necessary, change font. - if ( (m_navigateToHomeOnReload || m_bCleanupOnReload) && !ui.IsReloadingSkin() ) + if ( (m_navigateToHomeOnReload || m_bCleanupOnReload) && !ui.IsReloadingSkins() ) { - ui.CleanUpSkinReload(); + ui.CleanUpSkinsReload(); if (m_navigateToHomeOnReload || !g_NetworkManager.IsInSession()) { @@ -501,6 +504,7 @@ void UIController::tick() #endif } +#ifdef _WINDOWS64 //str1k3r - this is what actually does all the autoswitching void UIController::GetControllerType() { @@ -532,7 +536,7 @@ void UIController::GetControllerType() controlTooltipsPath = (ui.getScreenWidth() >= 1920) ? L"ControlTooltips\\HD\\Windows64HDControls.swf" : L"ControlTooltips\\Windows64Controls.swf"; } - //ReloadSingleSkin(eLibrary_ControlTooltips, controlTooltipsPath, (m_fScreenHeight >= 1080.0f) ? L"skinControlTooltipsHD.swf" : L"skinControlTooltips.swf"); + //ReloadSkin(eLibrary_ControlTooltips, controlTooltipsPath, (m_fScreenHeight >= 1080.0f) ? L"skinControlTooltipsHD.swf" : L"skinControlTooltips.swf"); for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) { @@ -575,9 +579,13 @@ wstring UIController::GetTooltipSkinPath() } } +#endif + void UIController::loadSkins() { +#ifdef _WINDOWS64 wstring tooltipsSkinPath = L""; +#endif wstring platformSkinPath = L""; #ifdef __PS3__ @@ -632,7 +640,7 @@ void UIController::loadSkins() m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinHDGraphicsTooltips.swf", L"skinHDGraphicsTooltips.swf"); m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinHDGraphicsLabels.swf", L"skinHDGraphicsLabels.swf"); #ifdef _WINDOWS64 - //m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf"); + m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf"); #endif m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinHDLabels.swf", L"skinHDLabels.swf"); m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinHDInGame.swf", L"skinHDInGame.swf"); @@ -649,7 +657,7 @@ void UIController::loadSkins() m_iggyLibraries[eLibrary_GraphicsTooltips] = loadSkin(L"skinGraphicsTooltips.swf", L"skinGraphicsTooltips.swf"); m_iggyLibraries[eLibrary_GraphicsLabels] = loadSkin(L"skinGraphicsLabels.swf", L"skinGraphicsLabels.swf"); #ifdef _WINDOWS64 - //m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltipsHD.swf"); + m_iggyLibraries[eLibrary_ControlTooltips] = loadSkin(tooltipsSkinPath, L"skinControlTooltips.swf"); #endif m_iggyLibraries[eLibrary_Labels] = loadSkin(L"skinLabels.swf", L"skinLabels.swf"); m_iggyLibraries[eLibrary_InGame] = loadSkin(L"skinInGame.swf", L"skinInGame.swf"); @@ -692,7 +700,8 @@ IggyLibrary UIController::loadSkin(const wstring &skinPath, const wstring &skinN return lib; } -void UIController::ReloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName) +//str1k3r - reloads a single skin +void UIController::ReloadSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName) { if(m_iggyLibraries[lib] != IGGY_INVALID_LIBRARY) { @@ -703,7 +712,8 @@ void UIController::ReloadSingleSkin(ELibraries lib, const wstring &skinPath, con m_iggyLibraries[lib] = loadSkin(skinPath, skinName); } -void UIController::ReloadSkin() +//str1k3r - reloads every skin +void UIController::ReloadSkins() { // Destroy all scene swf for(unsigned int i = 0; i < eUIGroup_COUNT; ++i) @@ -720,8 +730,8 @@ void UIController::ReloadSkin() m_iggyLibraries[i] = IGGY_INVALID_LIBRARY; } - m_reloadSkinThread = new C4JThread(reloadSkinThreadProc, (void*)this, "Reload skin thread"); - m_reloadSkinThread->SetProcessor(CPU_CORE_UI_SCENE); + m_reloadSkinsThread = new C4JThread(reloadSkinsThreadProc, (void*)this, "Reload skin thread"); + m_reloadSkinsThread->SetProcessor(CPU_CORE_UI_SCENE); // Navigate to the timer scene so that we can display something while the loading is happening // str1k3r - Exclude this from windows64 as its not needed @@ -731,7 +741,7 @@ void UIController::ReloadSkin() // str1k3r - Fixes 4J's issue with the screen staying on the timer scene if on another thread on windows64 #ifdef _WINDOWS64 - m_reloadSkinThread->Run(); + m_reloadSkinsThread->Run(); #endif //// Load new skin @@ -747,14 +757,14 @@ void UIController::ReloadSkin() //m_groups[eUIGroup_Fullscreen]->ReloadAll(); } -void UIController::StartReloadSkinThread() +void UIController::StartReloadSkinsThread() { - if(m_reloadSkinThread) m_reloadSkinThread->Run(); + if(m_reloadSkinsThread) m_reloadSkinsThread->Run(); } -int UIController::reloadSkinThreadProc(void* lpParam) +int UIController::reloadSkinsThreadProc(void* lpParam) { - EnterCriticalSection(&ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded + EnterCriticalSection(&ms_reloadSkinsCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded UIController *controller = (UIController *)lpParam; // Load new skin controller->loadSkins(); @@ -772,25 +782,25 @@ int UIController::reloadSkinThreadProc(void* lpParam) #ifndef _WINDOW64 controller->NavigateBack(0, false, eUIScene_COUNT, eUILayer_Tooltips); #endif - LeaveCriticalSection(&ms_reloadSkinCS); + LeaveCriticalSection(&ms_reloadSkinsCS); return 0; } -bool UIController::IsReloadingSkin() +bool UIController::IsReloadingSkins() { - return m_reloadSkinThread && (!m_reloadSkinThread->hasStarted() || m_reloadSkinThread->isRunning()); + return m_reloadSkinsThread && (!m_reloadSkinsThread->hasStarted() || m_reloadSkinsThread->isRunning()); } -bool UIController::IsExpectingOrReloadingSkin() +bool UIController::IsExpectingOrReloadingSkins() { - return Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || Minecraft::GetInstance()->skins->needsUIUpdate() || IsReloadingSkin() || PendingFontChange(); + return Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || Minecraft::GetInstance()->skins->needsUIUpdate() || IsReloadingSkins() || PendingFontChange(); } -void UIController::CleanUpSkinReload() +void UIController::CleanUpSkinsReload() { - delete m_reloadSkinThread; - m_reloadSkinThread = NULL; + delete m_reloadSkinsThread; + m_reloadSkinsThread = NULL; if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin()) { @@ -2645,7 +2655,7 @@ C4JStorage::EMessageResult UIController::RequestMessageBox(UINT uiTitle, UINT ui EUILayer layer = bIsError?eUILayer_Error:eUILayer_Alert; bool completed = false; - if(ui.IsReloadingSkin()) + if(ui.IsReloadingSkins()) { // Queue this message box QueuedMessageBoxData *queuedData = new QueuedMessageBoxData(); diff --git a/Minecraft.Client/Common/UI/UIController.h b/Minecraft.Client/Common/UI/UIController.h index 636766ea..815209e4 100644 --- a/Minecraft.Client/Common/UI/UIController.h +++ b/Minecraft.Client/Common/UI/UIController.h @@ -18,8 +18,8 @@ public: static __int64 iggyAllocCount; // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded - static CRITICAL_SECTION ms_reloadSkinCS; - static bool ms_bReloadSkinCSInitialised; + static CRITICAL_SECTION ms_reloadSkinsCS; + static bool ms_bReloadSkinsCSInitialised; protected: UIComponent_DebugUIConsole *m_uiDebugConsole; @@ -92,7 +92,7 @@ private: eLibrary_GraphicsTooltips, eLibrary_GraphicsLabels, #ifdef _WINDOWS64 - //eLibrary_ControlTooltips, + eLibrary_ControlTooltips, #endif eLibrary_Labels, eLibrary_InGame, @@ -146,7 +146,7 @@ private: unsigned int m_winUserIndex; //bool m_bSysUIShowing; bool m_bSystemUIShowing; - C4JThread *m_reloadSkinThread; + C4JThread *m_reloadSkinsThread; bool m_navigateToHomeOnReload; int m_accumulatedTicks; __uint64 m_lastUiSfx; // Tracks time (ms) of last UI sound effect @@ -210,15 +210,15 @@ private: IggyLibrary loadSkin(const wstring &skinPath, const wstring &skinName); public: - void ReloadSingleSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName); - void ReloadSkin(); - virtual void StartReloadSkinThread(); - virtual bool IsReloadingSkin(); - virtual bool IsExpectingOrReloadingSkin(); - virtual void CleanUpSkinReload(); + void ReloadSkin(ELibraries lib, const wstring &skinPath, const wstring &skinName); + void ReloadSkins(); + virtual void StartReloadSkinsThread(); + virtual bool IsReloadingSkins(); + virtual bool IsExpectingOrReloadingSkins(); + virtual void CleanUpSkinsReload(); private: - static int reloadSkinThreadProc(void* lpParam); + static int reloadSkinsThreadProc(void* lpParam); public: byteArray getMovieData(const wstring &filename); diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index abc54e84..283c032d 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -66,7 +66,7 @@ void UILayer::tick() void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) { - if(!ui.IsExpectingOrReloadingSkin()) + if(!ui.IsExpectingOrReloadingSkins()) { for(AUTO_VAR(it,m_components.begin()); it != m_components.end(); ++it) { @@ -92,7 +92,7 @@ void UILayer::render(S32 width, S32 height, C4JRender::eViewportType viewport) if(lowestRenderable < 0) lowestRenderable = 0; for(;lowestRenderable < m_sceneStack.size(); ++lowestRenderable) { - if(m_sceneStack[lowestRenderable]->isVisible() && (!ui.IsExpectingOrReloadingSkin() || m_sceneStack[lowestRenderable]->getSceneType()==eUIScene_Timer)) + if(m_sceneStack[lowestRenderable]->isVisible() && (!ui.IsExpectingOrReloadingSkins() || m_sceneStack[lowestRenderable]->getSceneType()==eUIScene_Timer)) { PIXBeginNamedEvent(0, "Rendering scene %d", m_sceneStack[lowestRenderable]->getSceneType() ); m_sceneStack[lowestRenderable]->render(width, height,viewport); diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 4334df15..38223f5f 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -267,7 +267,7 @@ bool UIScene::mapElementsAndNames() extern CRITICAL_SECTION s_loadSkinCS; void UIScene::loadMovie() { - EnterCriticalSection(&UIController::ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded + EnterCriticalSection(&UIController::ms_reloadSkinsCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded wstring moviePath = getMoviePath(); #ifdef __PS3__ @@ -408,7 +408,7 @@ void UIScene::loadMovie() app.DebugPrintf(app.USER_SR, "%ls - Total: %d, Expected: %d, Diff: %d\n", moviePath.c_str(), totalStatic + totalDynamic, afterTick - beforeLoad, (afterTick - beforeLoad) - (totalStatic + totalDynamic)); #endif - LeaveCriticalSection(&UIController::ms_reloadSkinCS); + LeaveCriticalSection(&UIController::ms_reloadSkinsCS); } @@ -911,7 +911,7 @@ void UIScene::handleGainFocus(bool navBack) void UIScene::updateTooltips() { - if(!ui.IsReloadingSkin()) + if(!ui.IsReloadingSkins()) ui.SetTooltips(m_iPad, -1); } diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index 8e863519..a4863e39 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -1675,7 +1675,7 @@ void UIScene_LoadOrJoinMenu::UpdateGamesList() if (m_bIgnoreInput) return; // If a texture pack is loading, or will be loading, then ignore this ( we are going to be destroyed anyway) - if( Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()) ) return; + if( Minecraft::GetInstance()->skins->getSelected()->isLoadingData() || (Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkins()) ) return; // if we're retrieving save info, don't show the list yet as we will be ignoring press events if(!m_bSavesDisplayed) diff --git a/Minecraft.Client/DLCTexturePack.cpp b/Minecraft.Client/DLCTexturePack.cpp index 49692501..2e77ab08 100644 --- a/Minecraft.Client/DLCTexturePack.cpp +++ b/Minecraft.Client/DLCTexturePack.cpp @@ -538,7 +538,7 @@ void DLCTexturePack::loadUI() #else if(m_archiveFile && m_archiveFile->hasFile(L"skin.swf")) { - ui.ReloadSkin(); + ui.ReloadSkins(); bUILoaded = true; } #endif @@ -550,7 +550,7 @@ void DLCTexturePack::loadUI() AbstractTexturePack::loadUI(); #ifndef _XBOX - if(hasAudio()==false && !ui.IsReloadingSkin()) + if(hasAudio()==false && !ui.IsReloadingSkins()) { #if (defined _DURANGO || _WINDOWS64) StorageManager.UnmountInstalledDLC(L"TPACK"); diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 85935974..a68d915f 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3329,7 +3329,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) } // 4J-JEV: Don't set tooltips when we're reloading the skin, it'll crash. - if (!ui.IsReloadingSkin()) ui.SetTooltips( iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); + if (!ui.IsReloadingSkins()) ui.SetTooltips( iPad, iA, iB, iX, iY, iLT, iRT, iLB, iRB, iLS, iRS); int wheel = 0; if (InputManager.GetValue(iPad, MINECRAFT_ACTION_LEFT_SCROLL, true) > 0 && gameMode->isInputAllowed(MINECRAFT_ACTION_LEFT_SCROLL) ) diff --git a/Minecraft.Client/TexturePackRepository.cpp b/Minecraft.Client/TexturePackRepository.cpp index 937d945c..ec2c3012 100644 --- a/Minecraft.Client/TexturePackRepository.cpp +++ b/Minecraft.Client/TexturePackRepository.cpp @@ -425,7 +425,7 @@ void TexturePackRepository::updateUI() lastSelected->unloadUI(); selected->loadUI(); Minimap::reloadColours(); - ui.StartReloadSkinThread(); + ui.StartReloadSkinsThread(); lastSelected = NULL; } } diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index 68100be2..cbf55574 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -878,8 +878,9 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, ui.tick(); ui.render(); - //str1k3r - now set the resolution a FUCK ton of times to tell 4J to fuck off with their hardcoded shit + //str1k3r - update RenderManager's & gdraw's resolution RenderManager.setResolution(g_iScreenWidth, g_iScreenHeight); + ui.updateResolution(g_iScreenWidth, g_iScreenHeight); // Present the frame. RenderManager.Present(); diff --git a/Minecraft.Client/Windows64/Windows64_UIController.cpp b/Minecraft.Client/Windows64/Windows64_UIController.cpp index 3c0c75b4..19e23261 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.cpp +++ b/Minecraft.Client/Windows64/Windows64_UIController.cpp @@ -95,6 +95,14 @@ void ConsoleUIController::render() #endif } +//str1k3r - update gdraw resolution +void ConsoleUIController::updateResolution(S32 w, S32 h) +{ +#ifdef _ENABLEIGGY + gdraw_D3D11_SetRendertargetSize(w, h); +#endif +} + void ConsoleUIController::beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion) { PIXBeginNamedEvent(0,"Starting Iggy custom draw\n"); diff --git a/Minecraft.Client/Windows64/Windows64_UIController.h b/Minecraft.Client/Windows64/Windows64_UIController.h index 41257500..a16652d2 100644 --- a/Minecraft.Client/Windows64/Windows64_UIController.h +++ b/Minecraft.Client/Windows64/Windows64_UIController.h @@ -11,6 +11,8 @@ public: void init(ID3D11Device *dev, ID3D11DeviceContext *ctx, ID3D11RenderTargetView* pRenderTargetView, ID3D11DepthStencilView* pDepthStencilView, S32 w, S32 h); void render(); + //str1k3r - updateResolution is a Windows64 exlusive thingy :3 + void updateResolution(S32 w, S32 h); void beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *region, CustomDrawData *customDrawRegion); virtual CustomDrawData *setupCustomDraw(UIScene *scene, IggyCustomDrawCallbackRegion *region); virtual CustomDrawData *calculateCustomDraw(IggyCustomDrawCallbackRegion *region); diff --git a/Minecraft.Client/Xbox/Xbox_UIController.cpp b/Minecraft.Client/Xbox/Xbox_UIController.cpp index 5d1d5753..6977d9aa 100644 --- a/Minecraft.Client/Xbox/Xbox_UIController.cpp +++ b/Minecraft.Client/Xbox/Xbox_UIController.cpp @@ -17,11 +17,11 @@ void ConsoleUIController::render() { } -void ConsoleUIController::StartReloadSkinThread() +void ConsoleUIController::StartReloadSkinsThread() { } -bool ConsoleUIController::IsReloadingSkin() +bool ConsoleUIController::IsReloadingSkins() { return false; } diff --git a/Minecraft.Client/Xbox/Xbox_UIController.h b/Minecraft.Client/Xbox/Xbox_UIController.h index 2b67b007..312fe348 100644 --- a/Minecraft.Client/Xbox/Xbox_UIController.h +++ b/Minecraft.Client/Xbox/Xbox_UIController.h @@ -8,8 +8,8 @@ public: virtual void init(); virtual void tick(); virtual void render(); - virtual void StartReloadSkinThread(); - virtual bool IsReloadingSkin(); + virtual void StartReloadSkinsThread(); + virtual bool IsReloadingSkins(); virtual void CleanUpSkinReload(); virtual bool NavigateToScene(int iPad, EUIScene scene, void *initData = NULL, EUILayer layer = eUILayer_Scene, EUIGroup group = eUIGroup_PAD); virtual bool NavigateBack(int iPad, bool forceUsePad = false, EUIScene eScene = eUIScene_COUNT, EUILayer eLayer = eUILayer_COUNT);