mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0afc9d6d10 | ||
|
|
2f4583f2e4 | ||
|
|
86af608bfc | ||
|
|
3a7489b2cc | ||
|
|
51947f8f93 | ||
|
|
e07f02d9bc | ||
|
|
6c07160503 | ||
|
|
a02e1b3487 | ||
|
|
86a7e97025 |
@@ -17,7 +17,7 @@ jobs:
|
||||
run: ./.github/workflows/scripts/common/update_base_translation.sh
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79
|
||||
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
|
||||
with:
|
||||
title: "Qt: Update Base Translation"
|
||||
commit-message: "[ci skip] Qt: Update Base Translation."
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
mv ./game_controller_db.txt ${{github.workspace}}/bin/resources/game_controller_db.txt
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@4320041ed380b20e97d388d56a7fb4f9b8c20e79
|
||||
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676
|
||||
with:
|
||||
title: "PAD: Update to latest controller database"
|
||||
commit-message: "[ci skip] PAD: Update to latest controller database."
|
||||
|
||||
@@ -1603,9 +1603,11 @@ SCAJ-20052:
|
||||
- "SCAJ-20001"
|
||||
SCAJ-20055:
|
||||
name: "Battle Gear 3"
|
||||
region: "NTSC-Unk"
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 3 # Stops car from falling through track.
|
||||
gsHWFixes:
|
||||
textureInsideRT: 1 # Fixes broken splitscreen mode.
|
||||
SCAJ-20056:
|
||||
name: "Bujingai"
|
||||
region: "NTSC-Unk"
|
||||
@@ -29110,7 +29112,7 @@ SLES-55191:
|
||||
nativeScaling: 1 # Fixes post-processing smoothness and position.
|
||||
getSkipCount: "GSC_GuitarHero"
|
||||
SLES-55192:
|
||||
name: "Steam Express"
|
||||
name: "Nitrobike"
|
||||
region: "PAL-M5"
|
||||
SLES-55193:
|
||||
name: "Disney/Pixar WALL-E"
|
||||
@@ -43481,6 +43483,8 @@ SLPM-65434:
|
||||
region: "NTSC-J"
|
||||
clampModes:
|
||||
vuClampMode: 3 # Stops car from falling through track.
|
||||
gsHWFixes:
|
||||
textureInsideRT: 1 # Fixes broken splitscreen mode.
|
||||
SLPM-65435:
|
||||
name: "北へ。~Diamond Dust~"
|
||||
name-sort: "きたへ Diamond Dust"
|
||||
|
||||
@@ -770,7 +770,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsWindow* settings_dialog,
|
||||
dialog()->registerWidgetHelp(m_osd.showInputRec, tr("Show Input Recording Status"), tr("Checked"),
|
||||
tr("Shows the status of the currently active input recording in the top-right corner of the display.."));
|
||||
|
||||
dialog()->registerWidgetHelp(m_osd.showTextureReplacements, tr("Show Texture Replacement Status"), tr("Checked"),
|
||||
dialog()->registerWidgetHelp(m_osd.showTextureReplacements, tr("Show Texture Replacement Status"), tr("Unchecked"),
|
||||
tr("Shows the status of the number of dumped and loaded texture replacements in the top-right corner of the display."));
|
||||
|
||||
dialog()->registerWidgetHelp(m_osd.warnAboutUnsafeSettings, tr("Warn About Unsafe Settings"), tr("Checked"),
|
||||
|
||||
@@ -4003,7 +4003,6 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
|
||||
const GSVertex* RESTRICT vertex = &m_vertex.buff[0];
|
||||
const u16* RESTRICT index = &m_index.buff[0];
|
||||
const GSVector4i& o = m_xyof;
|
||||
|
||||
if (GSLocalMemory::m_psm[m_context->FRAME.PSM].bpp == 16 && GSLocalMemory::m_psm[m_context->TEX0.PSM].bpp == 16)
|
||||
{
|
||||
@@ -4023,6 +4022,7 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
{
|
||||
const float q0 = vertex[index[0]].RGBAQ.Q == 0.0f ? FLT_MIN : vertex[index[0]].RGBAQ.Q;
|
||||
u0 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[0]].ST.S / q0) * 16.0f);
|
||||
|
||||
const float qn = m_v.RGBAQ.Q == 0.0f ? FLT_MIN : m_v.RGBAQ.Q;
|
||||
un = static_cast<int>((1 << m_context->TEX0.TW) * (m_v.ST.S / qn) * 16.0f);
|
||||
}
|
||||
@@ -4044,6 +4044,7 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
|
||||
const int x0 = static_cast<int>(vertex[index[0]].XYZ.X) - static_cast<int>(m_context->XYOFFSET.OFX);
|
||||
const int y0 = static_cast<int>(vertex[index[0]].XYZ.Y) - static_cast<int>(m_context->XYOFFSET.OFY);
|
||||
|
||||
const int x1 = static_cast<int>(vertex[index[1]].XYZ.X) - static_cast<int>(m_context->XYOFFSET.OFX);
|
||||
const int y1 = static_cast<int>(vertex[index[1]].XYZ.Y) - static_cast<int>(m_context->XYOFFSET.OFY);
|
||||
|
||||
@@ -4053,17 +4054,20 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
{
|
||||
u0 = static_cast<int>(vertex[index[0]].U);
|
||||
v0 = static_cast<int>(vertex[index[0]].V);
|
||||
|
||||
u1 = static_cast<int>(vertex[index[1]].U);
|
||||
v1 = static_cast<int>(vertex[index[1]].V);
|
||||
}
|
||||
else
|
||||
{
|
||||
const float q0 = vertex[index[0]].RGBAQ.Q == 0.0f ? FLT_MIN : vertex[index[0]].RGBAQ.Q;
|
||||
u0 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[0]].ST.S / q0) * 16.0f);
|
||||
v0 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[0]].ST.T / q0) * 16.0f);
|
||||
// Sprites have constant Q so use the second.
|
||||
const float q1 = vertex[index[1]].RGBAQ.Q == 0.0f ? FLT_MIN : vertex[index[1]].RGBAQ.Q;
|
||||
u1 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[1]].ST.S / q0) * 16.0f);
|
||||
v1 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[1]].ST.T / q0) * 16.0f);
|
||||
|
||||
u0 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[0]].ST.S / q1) * 16.0f);
|
||||
v0 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[0]].ST.T / q1) * 16.0f);
|
||||
|
||||
u1 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[1]].ST.S / q1) * 16.0f);
|
||||
v1 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[1]].ST.T / q1) * 16.0f);
|
||||
}
|
||||
|
||||
// Check that the source and destination sprite are exactly 8 pixel squares.
|
||||
@@ -4093,6 +4097,7 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
|
||||
const int x0 = static_cast<int>(vertex[index[0]].XYZ.X) - static_cast<int>(m_context->XYOFFSET.OFX);
|
||||
const int y0 = static_cast<int>(vertex[index[0]].XYZ.Y) - static_cast<int>(m_context->XYOFFSET.OFY);
|
||||
|
||||
const int x1 = static_cast<int>(vertex[index[1]].XYZ.X) - static_cast<int>(m_context->XYOFFSET.OFX);
|
||||
const int y1 = static_cast<int>(vertex[index[1]].XYZ.Y) - static_cast<int>(m_context->XYOFFSET.OFY);
|
||||
|
||||
@@ -4102,17 +4107,20 @@ __forceinline bool GSState::EarlyDetectShuffle(u32 prim)
|
||||
{
|
||||
u0 = static_cast<int>(vertex[index[0]].U);
|
||||
v0 = static_cast<int>(vertex[index[0]].V);
|
||||
|
||||
u1 = static_cast<int>(vertex[index[1]].U);
|
||||
v1 = static_cast<int>(vertex[index[1]].V);
|
||||
}
|
||||
else
|
||||
{
|
||||
const float q0 = vertex[index[0]].RGBAQ.Q == 0.0f ? FLT_MIN : vertex[index[0]].RGBAQ.Q;
|
||||
u0 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[0]].ST.S / q0) * 16.0f);
|
||||
v0 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[0]].ST.T / q0) * 16.0f);
|
||||
// Sprites have constant Q so use the second.
|
||||
const float q1 = vertex[index[1]].RGBAQ.Q == 0.0f ? FLT_MIN : vertex[index[1]].RGBAQ.Q;
|
||||
u1 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[1]].ST.S / q0) * 16.0f);
|
||||
v1 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[1]].ST.T / q0) * 16.0f);
|
||||
|
||||
u0 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[0]].ST.S / q1) * 16.0f);
|
||||
v0 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[0]].ST.T / q1) * 16.0f);
|
||||
|
||||
u1 = static_cast<int>((1 << m_context->TEX0.TW) * (vertex[index[1]].ST.S / q1) * 16.0f);
|
||||
v1 = static_cast<int>((1 << m_context->TEX0.TH) * (vertex[index[1]].ST.T / q1) * 16.0f);
|
||||
}
|
||||
|
||||
// Check that the source and destination sprite are exactly 8 pixel squares.
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace GLState
|
||||
|
||||
GSTextureOGL* rt = nullptr;
|
||||
GSTextureOGL* ds = nullptr;
|
||||
|
||||
bool rt_written;
|
||||
bool ds_written;
|
||||
|
||||
GLuint tex_unit[8];
|
||||
GLuint64 tex_handle[8];
|
||||
|
||||
@@ -67,6 +71,10 @@ namespace GLState
|
||||
|
||||
rt = nullptr;
|
||||
ds = nullptr;
|
||||
|
||||
rt_written = false;
|
||||
ds_written = false;
|
||||
|
||||
std::fill(std::begin(tex_unit), std::end(tex_unit), 0);
|
||||
std::fill(std::begin(tex_handle), std::end(tex_handle), 0);
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ namespace GLState
|
||||
|
||||
extern GSTextureOGL* rt; // render target
|
||||
extern GSTextureOGL* ds; // Depth-Stencil
|
||||
|
||||
extern bool rt_written; // Render Target written
|
||||
extern bool ds_written; // Depth Stencil written
|
||||
|
||||
extern GLuint tex_unit[8]; // shader input texture
|
||||
extern GLuint64 tex_handle[8]; // shader input texture
|
||||
|
||||
|
||||
@@ -2305,26 +2305,35 @@ void GSDeviceOGL::OMSetBlendState(bool enable, GLenum src_factor, GLenum dst_fac
|
||||
|
||||
void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVector4i* scissor)
|
||||
{
|
||||
g_perfmon.Put(GSPerfMon::RenderPasses, static_cast<double>(GLState::rt != rt || GLState::ds != ds));
|
||||
const bool rt_changed = (rt != GLState::rt);
|
||||
const bool ds_changed = (ds != GLState::ds);
|
||||
|
||||
g_perfmon.Put(GSPerfMon::RenderPasses, static_cast<double>(rt_changed || ds_changed));
|
||||
// Split up to avoid unbind/bind calls when clearing.
|
||||
|
||||
OMSetFBO(m_fbo);
|
||||
|
||||
GLState::rt_written = false;
|
||||
GLState::ds_written = false;
|
||||
|
||||
if (rt)
|
||||
{
|
||||
OMAttachRt(rt);
|
||||
CommitClear(rt, false);
|
||||
GLState::rt_written = rt_changed;
|
||||
}
|
||||
else
|
||||
OMAttachRt();
|
||||
|
||||
if (ds)
|
||||
{
|
||||
OMAttachDs(ds);
|
||||
CommitClear(ds, false);
|
||||
GLState::ds_written = ds_changed;
|
||||
}
|
||||
else
|
||||
OMAttachDs();
|
||||
|
||||
if (rt)
|
||||
CommitClear(rt, false);
|
||||
if (ds)
|
||||
CommitClear(ds, false);
|
||||
|
||||
if (rt || ds)
|
||||
{
|
||||
const GSVector2i size = rt ? rt->GetSize() : ds->GetSize();
|
||||
@@ -2578,14 +2587,6 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
|
||||
if (config.require_one_barrier || !m_features.texture_barrier)
|
||||
rt_hazard_barrier = false; // Already in place or not available
|
||||
|
||||
// Be careful of the rt already being bound and the blend using the RT without a barrier.
|
||||
if (rt_hazard_barrier)
|
||||
{
|
||||
// Ensure all depth writes are finished before sampling
|
||||
GL_INS("GL: Texture barrier to flush depth or rt before reading");
|
||||
g_perfmon.Put(GSPerfMon::Barriers, 1);
|
||||
glTextureBarrier();
|
||||
}
|
||||
// additional non-pipeline config stuff
|
||||
const bool point_size_enabled = config.vs.point_size;
|
||||
if (GLState::point_size != point_size_enabled)
|
||||
@@ -2644,15 +2645,27 @@ void GSDeviceOGL::RenderHW(GSHWDrawConfig& config)
|
||||
// avoid changing framebuffer just to switch from rt+depth to rt and vice versa
|
||||
GSTexture* draw_rt = colclip_rt ? colclip_rt : config.rt;
|
||||
GSTexture* draw_ds = config.ds;
|
||||
bool fb_optimization_needs_barrier = false;
|
||||
if (!draw_rt && GLState::rt && GLState::ds == draw_ds && config.tex != GLState::rt &&
|
||||
GLState::rt->GetSize() == draw_ds->GetSize())
|
||||
{
|
||||
draw_rt = GLState::rt;
|
||||
fb_optimization_needs_barrier = !GLState::rt_written;
|
||||
}
|
||||
else if (!draw_ds && GLState::ds && GLState::rt == draw_rt && config.tex != GLState::ds &&
|
||||
GLState::ds->GetSize() == draw_rt->GetSize())
|
||||
{
|
||||
draw_ds = GLState::ds;
|
||||
fb_optimization_needs_barrier = !GLState::ds_written;
|
||||
}
|
||||
|
||||
// Be careful of the rt already being bound and the blend using the RT without a barrier.
|
||||
if (fb_optimization_needs_barrier && rt_hazard_barrier)
|
||||
{
|
||||
// Ensure all depth writes are finished before sampling
|
||||
GL_INS("GL: Texture barrier to flush depth or rt before reading");
|
||||
g_perfmon.Put(GSPerfMon::Barriers, 1);
|
||||
glTextureBarrier();
|
||||
}
|
||||
|
||||
OMSetRenderTargets(draw_rt, draw_ds, &config.scissor);
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "BuildVersion.h"
|
||||
#include "Config.h"
|
||||
#include "Counters.h"
|
||||
#include "GS.h"
|
||||
#include "GS/GS.h"
|
||||
#include "GS/GSCapture.h"
|
||||
#include "GS/GSVector.h"
|
||||
@@ -32,7 +31,6 @@
|
||||
#include "common/Error.h"
|
||||
#include "common/FileSystem.h"
|
||||
#include "common/Path.h"
|
||||
#include "common/StringUtil.h"
|
||||
#include "common/Timer.h"
|
||||
|
||||
#include "fmt/chrono.h"
|
||||
@@ -40,14 +38,10 @@
|
||||
#include "imgui.h"
|
||||
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <deque>
|
||||
#include <limits>
|
||||
#include <mutex>
|
||||
#include <span>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
|
||||
InputRecordingUI::InputRecordingData g_InputRecordingData;
|
||||
|
||||
@@ -108,7 +102,7 @@ ImVec2 CalculateOSDPosition(OsdOverlayPos position, float margin, const ImVec2&
|
||||
ImVec2 CalculatePerformanceOverlayTextPosition(OsdOverlayPos position, float margin, const ImVec2& text_size, float window_width, float position_y)
|
||||
{
|
||||
const float abs_margin = std::abs(margin);
|
||||
|
||||
|
||||
// Get the X position based on horizontal alignment
|
||||
float x_pos;
|
||||
switch (position)
|
||||
@@ -118,13 +112,13 @@ ImVec2 CalculatePerformanceOverlayTextPosition(OsdOverlayPos position, float mar
|
||||
case OsdOverlayPos::BottomLeft:
|
||||
x_pos = abs_margin; // Left alignment
|
||||
break;
|
||||
|
||||
|
||||
case OsdOverlayPos::TopCenter:
|
||||
case OsdOverlayPos::Center:
|
||||
case OsdOverlayPos::BottomCenter:
|
||||
x_pos = (window_width - text_size.x) * 0.5f; // Center alignment
|
||||
break;
|
||||
|
||||
|
||||
case OsdOverlayPos::TopRight:
|
||||
case OsdOverlayPos::CenterRight:
|
||||
case OsdOverlayPos::BottomRight:
|
||||
@@ -132,7 +126,7 @@ ImVec2 CalculatePerformanceOverlayTextPosition(OsdOverlayPos position, float mar
|
||||
x_pos = window_width - text_size.x - abs_margin; // Right alignment
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return ImVec2(x_pos, position_y);
|
||||
}
|
||||
|
||||
@@ -150,6 +144,7 @@ namespace ImGuiManager
|
||||
static void DrawInputRecordingOverlay(float& position_y, float scale, float margin, float spacing);
|
||||
static void DrawVideoCaptureOverlay(float& position_y, float scale, float margin, float spacing);
|
||||
static void DrawTextureReplacementsOverlay(float& position_y, float scale, float margin, float spacing);
|
||||
static void DrawIndicatorsOverlay(float& position_y, float scale, float margin, float spacing);
|
||||
} // namespace ImGuiManager
|
||||
|
||||
static std::tuple<float, float> GetMinMax(std::span<const float> values)
|
||||
@@ -194,7 +189,6 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
const float shadow_offset = std::ceil(scale);
|
||||
|
||||
ImFont* const fixed_font = ImGuiManager::GetFixedFont();
|
||||
ImFont* const standard_font = ImGuiManager::GetStandardFont();
|
||||
const float font_size = ImGuiManager::GetFontSizeStandard();
|
||||
|
||||
ImDrawList* dl = ImGui::GetBackgroundDrawList();
|
||||
@@ -209,14 +203,14 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
|
||||
position_y = (GetWindowHeight() - (font_size * 8.0f)) * 0.5f;
|
||||
break;
|
||||
|
||||
|
||||
case OsdOverlayPos::BottomLeft:
|
||||
case OsdOverlayPos::BottomCenter:
|
||||
case OsdOverlayPos::BottomRight:
|
||||
|
||||
position_y = GetWindowHeight() - margin - (font_size * 15.0f + spacing * 14.0f);
|
||||
break;
|
||||
|
||||
|
||||
case OsdOverlayPos::TopLeft:
|
||||
case OsdOverlayPos::TopCenter:
|
||||
case OsdOverlayPos::TopRight:
|
||||
@@ -389,24 +383,6 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
FormatProcessorStat(s_gpu_usage_line, PerformanceMetrics::GetGPUUsage(), PerformanceMetrics::GetGPUAverageTime());
|
||||
DRAW_LINE(fixed_font, font_size, s_gpu_usage_line.c_str(), white_color);
|
||||
}
|
||||
|
||||
if (GSConfig.OsdShowIndicators)
|
||||
{
|
||||
const float target_speed = VMManager::GetTargetSpeed();
|
||||
const bool is_normal_speed = (target_speed == EmuConfig.EmulationSpeed.NominalScalar ||
|
||||
VMManager::IsTargetSpeedAdjustedToHost());
|
||||
if (!is_normal_speed)
|
||||
{
|
||||
if (target_speed == EmuConfig.EmulationSpeed.SlomoScalar) // Slow-Motion
|
||||
s_speed_icon = ICON_PF_SLOW_MOTION;
|
||||
else if (target_speed == EmuConfig.EmulationSpeed.TurboScalar) // Turbo
|
||||
s_speed_icon = ICON_FA_FORWARD_FAST;
|
||||
else // Unlimited
|
||||
s_speed_icon = ICON_FA_FORWARD;
|
||||
|
||||
DRAW_LINE(standard_font, font_size, s_speed_icon, white_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
// No refresh yet. Display cached lines.
|
||||
else
|
||||
@@ -451,14 +427,6 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
|
||||
if (GSConfig.OsdShowGPU)
|
||||
DRAW_LINE(fixed_font, font_size, s_gpu_usage_line.c_str(), white_color);
|
||||
|
||||
if (GSConfig.OsdShowIndicators)
|
||||
{
|
||||
const bool is_normal_speed = (VMManager::GetTargetSpeed() == EmuConfig.EmulationSpeed.NominalScalar ||
|
||||
VMManager::IsTargetSpeedAdjustedToHost());
|
||||
if (!is_normal_speed)
|
||||
DRAW_LINE(standard_font, font_size, s_speed_icon, white_color);
|
||||
}
|
||||
}
|
||||
|
||||
// Check every OSD frame because this is an animation.
|
||||
@@ -466,7 +434,7 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
{
|
||||
const ImVec2 history_size(200.0f * scale, 50.0f * scale);
|
||||
ImGui::SetNextWindowSize(ImVec2(history_size.x, history_size.y));
|
||||
|
||||
|
||||
const ImVec2 window_pos = CalculatePerformanceOverlayTextPosition(GSConfig.OsdPerformancePos, margin, history_size, GetWindowWidth(), position_y);
|
||||
ImGui::SetNextWindowPos(window_pos);
|
||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.25f));
|
||||
@@ -505,7 +473,7 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
SmallString frame_times_text;
|
||||
frame_times_text.format("Max: {:.1f} ms", max);
|
||||
text_size = fixed_font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, frame_times_text.c_str(), frame_times_text.c_str() + frame_times_text.length());
|
||||
|
||||
|
||||
float text_x;
|
||||
switch (GSConfig.OsdPerformancePos)
|
||||
{
|
||||
@@ -533,7 +501,7 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
|
||||
frame_times_text.format("Min: {:.1f} ms", min);
|
||||
text_size = fixed_font->CalcTextSizeA(font_size, FLT_MAX, 0.0f, frame_times_text.c_str(), frame_times_text.c_str() + frame_times_text.length());
|
||||
|
||||
|
||||
float min_text_x;
|
||||
switch (GSConfig.OsdPerformancePos)
|
||||
{
|
||||
@@ -565,17 +533,6 @@ __ri void ImGuiManager::DrawPerformanceOverlay(float& position_y, float scale, f
|
||||
ImGui::PopStyleColor(3);
|
||||
}
|
||||
}
|
||||
else if (!FullscreenUI::HasActiveWindow())
|
||||
{
|
||||
if (GSConfig.OsdShowIndicators)
|
||||
{
|
||||
// We should put the Pause icon in the top right regardless of performance overlay position
|
||||
text_size = standard_font->CalcTextSizeA(font_size, std::numeric_limits<float>::max(), -1.0f, ICON_FA_PAUSE, nullptr, nullptr);
|
||||
const ImVec2 pause_pos(GetWindowWidth() - margin - text_size.x, margin);
|
||||
dl->AddText(standard_font, font_size, ImVec2(pause_pos.x + shadow_offset, pause_pos.y + shadow_offset), IM_COL32(0, 0, 0, 100), ICON_FA_PAUSE);
|
||||
dl->AddText(standard_font, font_size, pause_pos, white_color, ICON_FA_PAUSE);
|
||||
}
|
||||
}
|
||||
|
||||
#undef DRAW_LINE
|
||||
}
|
||||
@@ -596,10 +553,10 @@ __ri void ImGuiManager::DrawSettingsOverlay(float scale, float margin, float spa
|
||||
} while (0)
|
||||
|
||||
if (Patch::GetAllActivePatchesCount() > 0 && EmuConfig.GS.OsdshowPatches)
|
||||
APPEND("DB={} P={} C={} | ",
|
||||
Patch::GetActiveGameDBPatchesCount(),
|
||||
Patch::GetActivePatchesCount(),
|
||||
Patch::GetActiveCheatsCount());
|
||||
APPEND("DB={} P={} C={} | ",
|
||||
Patch::GetActiveGameDBPatchesCount(),
|
||||
Patch::GetActivePatchesCount(),
|
||||
Patch::GetActiveCheatsCount());
|
||||
|
||||
if (EmuConfig.Speedhacks.EECycleRate != 0)
|
||||
APPEND("CR={} ", EmuConfig.Speedhacks.EECycleRate);
|
||||
@@ -988,6 +945,60 @@ __ri void ImGuiManager::DrawTextureReplacementsOverlay(float& position_y, float
|
||||
position_y += text_size.y + spacing;
|
||||
}
|
||||
|
||||
__ri void ImGuiManager::DrawIndicatorsOverlay(float& position_y, float scale, float margin, float spacing)
|
||||
{
|
||||
if (!GSConfig.OsdShowIndicators ||
|
||||
FullscreenUI::HasActiveWindow())
|
||||
return;
|
||||
|
||||
const float shadow_offset = std::ceil(scale);
|
||||
|
||||
ImFont* const standard_font = ImGuiManager::GetStandardFont();
|
||||
const float font_size = ImGuiManager::GetFontSizeStandard();
|
||||
|
||||
ImDrawList* dl = ImGui::GetBackgroundDrawList();
|
||||
std::string text;
|
||||
ImVec2 text_size;
|
||||
|
||||
text.reserve(64);
|
||||
#define DRAW_LINE(font, size, text, color) \
|
||||
do \
|
||||
{ \
|
||||
text_size = font->CalcTextSizeA(size, std::numeric_limits<float>::max(), -1.0f, (text), nullptr, nullptr); \
|
||||
dl->AddText(font, size, \
|
||||
ImVec2(GetWindowWidth() - margin - text_size.x + shadow_offset, position_y + shadow_offset), \
|
||||
IM_COL32(0, 0, 0, 100), (text)); \
|
||||
dl->AddText(font, size, ImVec2(GetWindowWidth() - margin - text_size.x, position_y), color, (text)); \
|
||||
position_y += text_size.y + spacing; \
|
||||
} while (0)
|
||||
|
||||
if (VMManager::GetState() != VMState::Paused)
|
||||
{
|
||||
// Draw Speed indicator
|
||||
const float target_speed = VMManager::GetTargetSpeed();
|
||||
const bool is_normal_speed = (target_speed == EmuConfig.EmulationSpeed.NominalScalar ||
|
||||
VMManager::IsTargetSpeedAdjustedToHost());
|
||||
if (!is_normal_speed)
|
||||
{
|
||||
if (target_speed == EmuConfig.EmulationSpeed.SlomoScalar) // Slow-Motion
|
||||
s_speed_icon = ICON_PF_SLOW_MOTION;
|
||||
else if (target_speed == EmuConfig.EmulationSpeed.TurboScalar) // Turbo
|
||||
s_speed_icon = ICON_FA_FORWARD_FAST;
|
||||
else // Unlimited
|
||||
s_speed_icon = ICON_FA_FORWARD;
|
||||
|
||||
DRAW_LINE(standard_font, font_size, s_speed_icon, white_color);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Draw Pause indicator
|
||||
const TinyString pause_msg = TinyString::from_format(TRANSLATE_FS("ImGuiOverlays", "{} Paused"), ICON_FA_PAUSE);
|
||||
DRAW_LINE(standard_font, font_size, pause_msg, white_color);
|
||||
}
|
||||
#undef DRAW_LINE
|
||||
}
|
||||
|
||||
namespace SaveStateSelectorUI
|
||||
{
|
||||
namespace
|
||||
@@ -1068,7 +1079,8 @@ void SaveStateSelectorUI::Open(float open_time /* = DEFAULT_OPEN_TIME */)
|
||||
RefreshHotkeyLegend();
|
||||
}
|
||||
|
||||
bool SaveStateSelectorUI::IsOpen(){
|
||||
bool SaveStateSelectorUI::IsOpen()
|
||||
{
|
||||
return s_open;
|
||||
}
|
||||
|
||||
@@ -1418,9 +1430,10 @@ void ImGuiManager::RenderOverlays()
|
||||
{
|
||||
const float scale = ImGuiManager::GetGlobalScale();
|
||||
const float margin = std::ceil(10.0f * scale);
|
||||
const float spacing = std::ceil(5.0f * scale);
|
||||
const float spacing = std::ceil(5.0f * scale);
|
||||
float position_y = margin;
|
||||
|
||||
DrawIndicatorsOverlay(position_y, scale, margin, spacing);
|
||||
DrawVideoCaptureOverlay(position_y, scale, margin, spacing);
|
||||
DrawInputRecordingOverlay(position_y, scale, margin, spacing);
|
||||
DrawTextureReplacementsOverlay(position_y, scale, margin, spacing);
|
||||
|
||||
@@ -673,7 +673,7 @@ const char* Pcsx2Config::GSOptions::DEFAULT_CAPTURE_CONTAINER = "mp4";
|
||||
|
||||
const char* Pcsx2Config::AchievementsOptions::OverlayPositionNames[(size_t)AchievementOverlayPosition::MaxCount + 1] = {
|
||||
"TopLeft",
|
||||
"TopCenter",
|
||||
"TopCenter",
|
||||
"TopRight",
|
||||
"CenterLeft",
|
||||
"Center",
|
||||
@@ -741,7 +741,7 @@ Pcsx2Config::GSOptions::GSOptions()
|
||||
OsdShowInputs = false;
|
||||
OsdShowVideoCapture = true;
|
||||
OsdShowInputRec = true;
|
||||
OsdShowTextureReplacements = true;
|
||||
OsdShowTextureReplacements = false;
|
||||
|
||||
HWDownloadMode = GSHardwareDownloadMode::Enabled;
|
||||
HWSpinGPUForReadbacks = false;
|
||||
@@ -1906,7 +1906,7 @@ void Pcsx2Config::AchievementsOptions::LoadSave(SettingsWrapper& wrap)
|
||||
|
||||
bool Pcsx2Config::AchievementsOptions::operator==(const AchievementsOptions& right) const
|
||||
{
|
||||
return OpEqu(bitset) && OpEqu(NotificationsDuration) && OpEqu(LeaderboardsDuration) &&
|
||||
return OpEqu(bitset) && OpEqu(NotificationsDuration) && OpEqu(LeaderboardsDuration) &&
|
||||
OpEqu(OverlayPosition) && OpEqu(NotificationPosition);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user