From f4d0693714098dcdec0ce2a7129fcb3dcc2f1c84 Mon Sep 17 00:00:00 2001 From: Fayaz Shaikh <61674751+fayaz12g@users.noreply.github.com> Date: Tue, 3 Mar 2026 17:27:19 -0500 Subject: [PATCH] Remove some logic that didn't work --- Minecraft.Client/Common/UI/UIController.cpp | 26 ++------------- Minecraft.Client/Common/UI/UIGroup.cpp | 36 --------------------- Minecraft.Client/Common/UI/UIGroup.h | 2 -- Minecraft.Client/Common/UI/UILayer.cpp | 30 ----------------- Minecraft.Client/Common/UI/UILayer.h | 1 - Minecraft.Client/Common/UI/UIScene.cpp | 27 ---------------- Minecraft.Client/Common/UI/UIScene.h | 1 - 7 files changed, 3 insertions(+), 120 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIController.cpp b/Minecraft.Client/Common/UI/UIController.cpp index 2d11ff247..759ca7af5 100644 --- a/Minecraft.Client/Common/UI/UIController.cpp +++ b/Minecraft.Client/Common/UI/UIController.cpp @@ -1219,16 +1219,16 @@ void UIController::getRenderDimensions(C4JRender::eViewportType viewport, S32 &w float targetAspect = 16.0f / 9.0f; float currentAspect = aar_Width / aar_Height; + // Screen is Ultrawide (Wider than 16:9): if (currentAspect > targetAspect) { - // Screen is Ultrawide (Wider than 16:9): // Lock height to screen, calculate width based on 16:9 ratio width = (S32)(aar_Height * targetAspect); height = (S32)aar_Height; } + // Screen is Tall (Taller than 16:9, e.g. 4:3, 16:10, Steam Deck): else if (currentAspect < targetAspect) { - // Screen is Tall (Taller than 16:9, e.g. 4:3, 16:10, Steam Deck): // Lock width to screen, calculate height based on 16:9 ratio width = (S32)aar_Width; // Height = Width / 1.777 @@ -1262,31 +1262,11 @@ void UIController::getRenderDimensions(C4JRender::eViewportType viewport, S32 &w } } -// AAR - Handle window resizing by updating the width and height variables -// AAR - Handle window resizing by updating the width and height variables // AAR - Handle window resizing by updating the width and height variables void UIController::resize(S32 width, S32 height) { - // Store the new dimensions aar_Width = (float)width; aar_Height = (float)height; - m_fScreenWidth = (float)width; - m_fScreenHeight = (float)height; - - // Notify all UIGroups about the resize - for (unsigned int i = 0; i < eUIGroup_COUNT; ++i) - { - if (m_groups[i]) - { - m_groups[i]->OnResize(width, height); - } - } - - // Force a render position update on next render - m_currentRenderViewport = (C4JRender::eViewportType)-1; // Force recalculation - - // Update the Iggy global display if needed - // (Some Iggy versions need global display size updates) } void UIController::setupRenderPosition(C4JRender::eViewportType viewport) @@ -1301,9 +1281,9 @@ void UIController::setupRenderPosition(C4JRender::eViewportType viewport) switch( viewport ) { + // AnyAspectRatio support by Fayaz (related code has AAR prefix) case C4JRender::VIEWPORT_TYPE_FULLSCREEN: { - // AnyAspectRatio support by Fayaz (related code has AAR prefix) // Calculate target 16:9 width based on current height float targetAspect = 16.0f / 9.0f; float currentAspect = aar_Width / aar_Height; diff --git a/Minecraft.Client/Common/UI/UIGroup.cpp b/Minecraft.Client/Common/UI/UIGroup.cpp index 4db27cdb0..1594b06f1 100644 --- a/Minecraft.Client/Common/UI/UIGroup.cpp +++ b/Minecraft.Client/Common/UI/UIGroup.cpp @@ -333,42 +333,6 @@ bool UIGroup::IsFullscreenGroup() return m_group == eUIGroup_Fullscreen; } -void UIGroup::OnResize(S32 width, S32 height) -{ - // Update all layers in this group - for (int layer = 0; layer < LAYER_COUNT; ++layer) - { - if (m_layers[layer]) - { - m_layers[layer]->OnResize(); - } - } - - //// Update HUD if it exists - //if (m_hud) - //{ - // m_hud->OnResize(); - //} - - //// Update tooltips if they exist - //if (m_tooltips) - //{ - // m_tooltips->OnResize(); - //} - - //// Update tutorial popup if it exists - //if (m_tutorialPopup) - //{ - // m_tutorialPopup->OnResize(); - //} - - //// Update press start to play if it exists - //if (m_pressStartToPlay) - //{ - // m_pressStartToPlay->OnResize(); - //} -} - void UIGroup::handleUnlockFullVersion() { for(unsigned int i = 0; i < eUILayer_COUNT; ++i) diff --git a/Minecraft.Client/Common/UI/UIGroup.h b/Minecraft.Client/Common/UI/UIGroup.h index 981fd0e68..306c0eff9 100644 --- a/Minecraft.Client/Common/UI/UIGroup.h +++ b/Minecraft.Client/Common/UI/UIGroup.h @@ -102,8 +102,6 @@ public: void handleUnlockFullVersion(); - void OnResize(S32 width, S32 height); - static const int LAYER_COUNT = eUILayer_COUNT; void PrintTotalMemoryUsage(__int64 &totalStatic, __int64 &totalDynamic); diff --git a/Minecraft.Client/Common/UI/UILayer.cpp b/Minecraft.Client/Common/UI/UILayer.cpp index 7a8211d8a..6f816bc5e 100644 --- a/Minecraft.Client/Common/UI/UILayer.cpp +++ b/Minecraft.Client/Common/UI/UILayer.cpp @@ -872,36 +872,6 @@ C4JRender::eViewportType UILayer::getViewport() return m_parentGroup->GetViewportType(); } -void UILayer::OnResize() -{ - // Update all components - for (auto component : m_components) - { - if (component) - { - component->OnResize(); - } - } - - // Update all scenes in the stack - for (auto scene : m_sceneStack) - { - if (scene) - { - scene->OnResize(); - } - } - - // Update any scenes pending deletion - for (auto scene : m_scenesToDelete) - { - if (scene) - { - scene->OnResize(); - } - } -} - void UILayer::handleUnlockFullVersion() { for(AUTO_VAR(it, m_sceneStack.begin()); it != m_sceneStack.end(); ++it) diff --git a/Minecraft.Client/Common/UI/UILayer.h b/Minecraft.Client/Common/UI/UILayer.h index 4209a7e83..98c81ca96 100644 --- a/Minecraft.Client/Common/UI/UILayer.h +++ b/Minecraft.Client/Common/UI/UILayer.h @@ -34,7 +34,6 @@ public: UIGroup *m_parentGroup; public: UILayer(UIGroup *parent); - void UILayer::OnResize(); void tick(); void render(S32 width, S32 height, C4JRender::eViewportType viewport); void getRenderDimensions(S32 &width, S32 &height); diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 16c176ce2..ae63af774 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -1199,33 +1199,6 @@ void UIScene::_handleFocusChange(F64 controlId, F64 childId) ui.PlayUISFX(eSFX_Focus); } -void UIScene::OnResize() -{ - if (!swf) - { - return; - } - - // Update the Iggy player with new display size - S32 width, height; - m_parentLayer->getRenderDimensions(width, height); - IggyPlayerSetDisplaySize(swf, width, height); - - // Update safe zone - updateSafeZone(); - - // Notify the Flash movie about resize (if it has a resize handler) - IggyDataValue result; - IggyResult out = IggyPlayerCallMethodRS(getMovie(), &result, - IggyPlayerRootPath(getMovie()), - registerFastName(L"OnResize"), - 0, NULL); - - - // Force a redraw of cached content - m_needsCacheRendered = true; -} - void UIScene::UpdateDisplaySize() { if (!swf) diff --git a/Minecraft.Client/Common/UI/UIScene.h b/Minecraft.Client/Common/UI/UIScene.h index 1f4c37584..3027ca617 100644 --- a/Minecraft.Client/Common/UI/UIScene.h +++ b/Minecraft.Client/Common/UI/UIScene.h @@ -122,7 +122,6 @@ protected: virtual bool mapElementsAndNames(); void initialiseMovie(); void loadMovie(); - virtual void OnResize(); virtual void UpdateDisplaySize(); private: