From b08521425bfbeff4c8a0a120d7fa5f27e0694bb6 Mon Sep 17 00:00:00 2001 From: John Johns Date: Wed, 7 Apr 2021 15:36:47 -0700 Subject: [PATCH] More aspect ratio fixes from Hoikas and Deledrius ultrawide: https://github.com/H-uru/Plasma/commit/2dc3d527d428fa01bdec4fa56300919c434dc679 fullscreen default: https://github.com/H-uru/Plasma/commit/7519fe403b71d9637af59e524478de4bcb5fd123 voice chat icon: https://github.com/H-uru/Plasma/commit/060c710ab5788a72285085b4f5ccd1fd021c2488 gui screenshots fix (aspect ratio parts ONLY): https://github.com/H-uru/Plasma/commit/c4e10aa11bf6d8dc5f25d81647d45f3446b91bee --- .../Sources/Plasma/Apps/plClient/plClient.cpp | 14 ++++++++++++-- .../Plasma/PubUtilLib/plAudio/plVoiceChat.cpp | 10 +++++++--- .../PubUtilLib/plPipeline/plCaptureRender.cpp | 2 ++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp index a490f452..c1013bf1 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2265,8 +2265,6 @@ void plClient::IDetectAudioVideoSettings() if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev) refDevice = true; - plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; - plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth; #if defined(HS_DEBUGGING) || defined(DEBUG) plPipeline::fDefaultPipeParams.Windowed = true; @@ -2274,6 +2272,18 @@ void plClient::IDetectAudioVideoSettings() plPipeline::fDefaultPipeParams.Windowed = false; #endif + // Use current desktop resolution for fullscreen mode + if(!plPipeline::fDefaultPipeParams.Windowed) + { + plPipeline::fDefaultPipeParams.Width = GetSystemMetrics(SM_CXSCREEN); + plPipeline::fDefaultPipeParams.Height = GetSystemMetrics(SM_CYSCREEN); + } + else + { + plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; + plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; + } + plPipeline::fDefaultPipeParams.Shadows = 0; // enable shadows if TnL is available, meaning not an intel extreme. if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DTnLHalDev) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp index 3edfdae9..f8511e65 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp @@ -86,7 +86,7 @@ plVoiceRecorder::plVoiceRecorder() plPlateManager::Instance().CreatePlate( &fDisabledIcon ); fDisabledIcon->CreateFromResource( MICROPHONE ); fDisabledIcon->SetPosition(-0.90, -0.90); - fDisabledIcon->SetSize(0.0675, 0.09); + fDisabledIcon->SetSize(0.064, 0.064, true); fDisabledIcon->SetVisible(false); plPlateManager::Instance().CreatePlate( &fTalkIcon ); @@ -210,13 +210,16 @@ void plVoiceRecorder::DrawDisabledIcon(hsBool b) { fDisabledIcon->CreateFromResource( MICROPHONE ); fDisabledIcon->SetPosition(-0.90, -0.90); - fDisabledIcon->SetSize(0.0675, 0.09); + fDisabledIcon->SetSize(0.064, 0.064, true); fDisabledIcon->SetVisible(false); } } if (fDisabledIcon) + { + fDisabledIcon->SetSize(0.064, 0.064, true); // Re-compute plate size in case the aspect ratio has changed. fDisabledIcon->SetVisible(b); + } } void plVoiceRecorder::DrawTalkIcon(hsBool b) @@ -227,13 +230,14 @@ void plVoiceRecorder::DrawTalkIcon(hsBool b) if (fTalkIcon) { fTalkIcon->CreateFromResource( TALKING ); fTalkIcon->SetPosition(-0.9,-0.9); - fTalkIcon->SetSize(0.0675, 0.09); + fTalkIcon->SetSize(0.064, 0.064, true); fTalkIcon->SetVisible(false); } } if (fTalkIcon) { + fTalkIcon->SetSize(0.064, 0.064, true); // Re-compute plate size in case the aspect ratio has changed. fTalkIcon->SetVisible(b); } } diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp index 498f9e44..0ef3b628 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPipeline/plCaptureRender.cpp @@ -91,6 +91,7 @@ void plCaptureRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr) SetClearDepth(1); // render all GUI items + pfGameGUIMgr::GetInstance()->SetAspectRatio((float)fRenderTarget->GetWidth() / (float)fRenderTarget->GetHeight()); std::vector guiRenderMods = pfGameGUIMgr::GetInstance()->GetDlgRenderMods(); for (int i = (int)guiRenderMods.size() - 1; i >= 0; i--) // render in reverse, so dialogs on the bottom get rendered first { @@ -104,6 +105,7 @@ void plCaptureRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr) pipe->PopRenderRequest(this); } } + pfGameGUIMgr::GetInstance()->SetAspectRatio((float)pipe->Width() / (float)pipe->Height()); // Callback on plCaptureRender to process the render target into a mipmap // and send it back to the requester.