diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf deleted file mode 100644 index 11bf53e7..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/wiiU.swf and /dev/null differ diff --git a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf b/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf deleted file mode 100644 index 8f05344e..00000000 Binary files a/Minecraft.Client/Common/Media/MediaWindows64/Graphics/ControlType/windows_bak.swf and /dev/null differ diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 2e19cdfd..951b53b0 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -189,7 +189,7 @@ static void RADLINK DeallocateFunction ( void * alloc_callback_user_data , void #ifdef _WINDOWS64 static wstring GetControlTypeSkinPath(int controlType, bool hd) { - const wchar_t *skinName = L"PS4"; + const wchar_t *skinName = L"windows"; // default to windows if control type is unknown switch(controlType) { @@ -203,7 +203,7 @@ static wstring GetControlTypeSkinPath(int controlType, bool hd) skinName = L"xbox360"; break; case 3: - skinName = L"vita"; + skinName = L"vita"; // not implemented yet break; case 4: skinName = L"PS3"; @@ -215,7 +215,7 @@ static wstring GetControlTypeSkinPath(int controlType, bool hd) skinName = L"WiiU"; break; case 7: - skinName = L"Switch"; + skinName = L"Switch"; // not implemented yet break; default: break; @@ -243,6 +243,14 @@ UIController::UIController() m_moj11 = nullptr; m_unicodeBitmapFont = nullptr; +#ifdef _WINDOWS64 + m_savedPlatformSkinHD = IGGY_INVALID_LIBRARY; + m_savedPlatformSkin = IGGY_INVALID_LIBRARY; + m_panoramaPlatformSkinHD = IGGY_INVALID_LIBRARY; + m_panoramaPlatformSkin = IGGY_INVALID_LIBRARY; + m_platformSkinOverrideDepth = 0; +#endif + // 4J-JEV: It's important that these remain the same, unless updateCurrentLanguage is going to be called. m_eCurrentFont = m_eTargetFont = eFont_NotLoaded; @@ -766,6 +774,14 @@ void UIController::ReloadSkin() m_iggyLibraries[i] = IGGY_INVALID_LIBRARY; } +#ifdef _WINDOWS64 + m_savedPlatformSkinHD = IGGY_INVALID_LIBRARY; + m_savedPlatformSkin = IGGY_INVALID_LIBRARY; + m_panoramaPlatformSkinHD = IGGY_INVALID_LIBRARY; + m_panoramaPlatformSkin = IGGY_INVALID_LIBRARY; + m_platformSkinOverrideDepth = 0; +#endif + #ifdef _WINDOWS64 // 4J Stu - Don't load on a thread on windows. I haven't investigated this in detail, so a quick fix reloadSkinThreadProc(this); @@ -797,6 +813,70 @@ void UIController::StartReloadSkinThread() if(m_reloadSkinThread) m_reloadSkinThread->Run(); } +#ifdef _WINDOWS64 +void UIController::PushDefaultPlatformSkinForPanorama() +{ + if(m_platformSkinOverrideDepth++ > 0) + { + return; + } + + m_savedPlatformSkinHD = m_iggyLibraries[eLibrary_Platform]; + m_savedPlatformSkin = m_iggyLibraries[eLibraryFallback_Platform]; + m_panoramaPlatformSkinHD = IGGY_INVALID_LIBRARY; + m_panoramaPlatformSkin = IGGY_INVALID_LIBRARY; + + const wstring defaultHd = L"Graphics\\ControlType\\HD\\windowsHD.swf"; + const wstring defaultSd = L"Graphics\\ControlType\\windows.swf"; + + IggyLibrary hdLib = loadSkin(defaultHd, L"platformskinHD.swf"); + if(hdLib != IGGY_INVALID_LIBRARY) + { + m_panoramaPlatformSkinHD = hdLib; + m_iggyLibraries[eLibrary_Platform] = hdLib; + } + + IggyLibrary sdLib = loadSkin(defaultSd, L"platformskin.swf"); + if(sdLib != IGGY_INVALID_LIBRARY) + { + m_panoramaPlatformSkin = sdLib; + m_iggyLibraries[eLibraryFallback_Platform] = sdLib; + } +} + +void UIController::PopDefaultPlatformSkinForPanorama() +{ + if(m_platformSkinOverrideDepth == 0) + { + return; + } + if(--m_platformSkinOverrideDepth > 0) + { + return; + } + + if(m_panoramaPlatformSkinHD != IGGY_INVALID_LIBRARY) + { + IggyLibraryDestroy(m_panoramaPlatformSkinHD); + m_panoramaPlatformSkinHD = IGGY_INVALID_LIBRARY; + } + if(m_panoramaPlatformSkin != IGGY_INVALID_LIBRARY) + { + IggyLibraryDestroy(m_panoramaPlatformSkin); + m_panoramaPlatformSkin = IGGY_INVALID_LIBRARY; + } + + if(m_savedPlatformSkinHD != IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibrary_Platform] = m_savedPlatformSkinHD; + } + if(m_savedPlatformSkin != IGGY_INVALID_LIBRARY) + { + m_iggyLibraries[eLibraryFallback_Platform] = m_savedPlatformSkin; + } +} +#endif + int UIController::reloadSkinThreadProc(void* lpParam) { EnterCriticalSection(&ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded diff --git a/Minecraft.Client/Common/UI/UIController.h b/Minecraft.Client/Common/UI/UIController.h index 776de903..8c995d1e 100644 --- a/Minecraft.Client/Common/UI/UIController.h +++ b/Minecraft.Client/Common/UI/UIController.h @@ -187,6 +187,14 @@ private: int m_accumulatedTicks; uint64_t m_lastUiSfx; // Tracks time (ms) of last UI sound effect +#ifdef _WINDOWS64 + IggyLibrary m_savedPlatformSkinHD; + IggyLibrary m_savedPlatformSkin; + IggyLibrary m_panoramaPlatformSkinHD; + IggyLibrary m_panoramaPlatformSkin; + int m_platformSkinOverrideDepth; +#endif + D3D11_RECT m_customRenderingClearRect; unordered_map m_registeredCallbackScenes; // A collection of scenes and unique id's that are used in async callbacks so we can safely handle when they get destroyed @@ -253,6 +261,11 @@ public: virtual bool IsExpectingOrReloadingSkin(); virtual void CleanUpSkinReload(); +#ifdef _WINDOWS64 + void PushDefaultPlatformSkinForPanorama(); + void PopDefaultPlatformSkinForPanorama(); +#endif + private: static int reloadSkinThreadProc(void* lpParam); diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 58934161..7b69526a 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -19,6 +19,7 @@ UIScene::UIScene(int iPad, UILayer *parentLayer) bHasFocus = false; m_hasTickedOnce = false; m_bFocussedOnce = false; + m_bPanoramaUsesDefaultPlatformSkin = false; m_bVisible = true; m_bCanHandleInput = false; m_bIsReloading = false; @@ -38,6 +39,12 @@ UIScene::UIScene(int iPad, UILayer *parentLayer) UIScene::~UIScene() { + if(m_bPanoramaUsesDefaultPlatformSkin) + { + ui.PopDefaultPlatformSkinForPanorama(); + m_bPanoramaUsesDefaultPlatformSkin = false; + } + /* Destroy the Iggy player. */ IggyPlayerDestroy( swf ); @@ -56,6 +63,12 @@ UIScene::~UIScene() void UIScene::destroyMovie() { + if(m_bPanoramaUsesDefaultPlatformSkin) + { + ui.PopDefaultPlatformSkinForPanorama(); + m_bPanoramaUsesDefaultPlatformSkin = false; + } + /* Destroy the Iggy player. */ IggyPlayerDestroy( swf ); swf = nullptr; @@ -74,6 +87,12 @@ void UIScene::reloadMovie(bool force) m_bIsReloading = true; if(swf) { + if(m_bPanoramaUsesDefaultPlatformSkin) + { + ui.PopDefaultPlatformSkinForPanorama(); + m_bPanoramaUsesDefaultPlatformSkin = false; + } + /* Destroy the Iggy player. */ IggyPlayerDestroy( swf ); @@ -279,6 +298,15 @@ void UIScene::loadMovie() EnterCriticalSection(&UIController::ms_reloadSkinCS); // MGH - added to prevent crash loading Iggy movies while the skins were being reloaded wstring moviePath = getMoviePath(); +#ifdef _WINDOWS64 + const bool isPanoramaMovie = (moviePath == L"Panorama" || moviePath == L"PanoramaSplit"); + if(isPanoramaMovie) + { + ui.PushDefaultPlatformSkinForPanorama(); + m_bPanoramaUsesDefaultPlatformSkin = true; + } +#endif + #ifdef __PS3__ if(RenderManager.IsWidescreen()) { diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index e232e48d..59502a5b 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -89,6 +89,7 @@ protected: bool m_bIsReloading; bool m_bFocussedOnce; + bool m_bPanoramaUsesDefaultPlatformSkin; int m_movieWidth, m_movieHeight; int m_renderWidth, m_renderHeight; diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp index c418ff9b..8dca0ffa 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.cpp @@ -3,16 +3,16 @@ #include "UI.h" #include "UIScene_SettingsUIMenu.h" -int UIScene_SettingsUIMenu::m_iControlTypeSettingA[8]= +int UIScene_SettingsUIMenu::m_iControlTypeSettingA[6]= { IDS_CONTROLTYPE_KBM, IDS_CONTROLTYPE_XBOXONE, IDS_CONTROLTYPE_XBOX360, - IDS_CONTROLTYPE_VITA, + // IDS_CONTROLTYPE_VITA, IDS_CONTROLTYPE_PLAYSTATION3, IDS_CONTROLTYPE_PLAYSTATION4, IDS_CONTROLTYPE_WIIU, - IDS_CONTROLTYPE_SWITCH, + // IDS_CONTROLTYPE_SWITCH, }; UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) @@ -51,7 +51,7 @@ UIScene_SettingsUIMenu::UIScene_SettingsUIMenu(int iPad, void *initData, UILayer m_sliderUISizeSplitscreen.init(TempString,eControl_UISizeSplitscreen,1,3,app.GetGameSettings(m_iPad,eGameSetting_UISizeSplitscreen)+1); swprintf( (WCHAR *)TempString, 256, L"%ls: %ls", app.GetString( IDS_SLIDER_CONTROLTYPE ),app.GetString(m_iControlTypeSettingA[app.GetGameSettings(m_iPad,eGameSetting_ControlType)])); - m_sliderControlType.init(TempString,eControl_ControlType,0,7,app.GetGameSettings(m_iPad,eGameSetting_ControlType)); + m_sliderControlType.init(TempString,eControl_ControlType,0,5,app.GetGameSettings(m_iPad,eGameSetting_ControlType)); doHorizontalResizeCheck(); diff --git a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h index 31623249..5f12d248 100644 --- a/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_SettingsUIMenu.h @@ -5,7 +5,7 @@ class UIScene_SettingsUIMenu : public UIScene { protected: - static int m_iControlTypeSettingA[8]; + static int m_iControlTypeSettingA[6]; private: enum EControls {