mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ab84aaa29 | ||
|
|
9842b11815 | ||
|
|
083fb5a1e6 | ||
|
|
98cdd3446b | ||
|
|
9bcbf43695 | ||
|
|
e3c988aa8b | ||
|
|
06be543d32 | ||
|
|
1fd22dcc1c | ||
|
|
e3afdde981 | ||
|
|
698df49e5e | ||
|
|
ff5c90ec5e | ||
|
|
1e075d23b2 | ||
|
|
2b172903b9 |
@@ -19,7 +19,7 @@ LIBJPEG=9f
|
||||
LIBPNG=1.6.45
|
||||
LIBWEBP=1.5.0
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
SDL=SDL3-3.2.6
|
||||
SDL=SDL3-3.2.8
|
||||
QT=6.8.2
|
||||
ZSTD=1.5.7
|
||||
|
||||
@@ -37,7 +37,7 @@ fd6f417fe9e3a071cf1424a5152d926a34c4a3c5070745470be6cf12a404ed79 $LIBBACKTRACE.
|
||||
926485350139ffb51ef69760db35f78846c805fef3d59bfdcb2fba704663f370 libpng-$LIBPNG.tar.xz
|
||||
7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c libwebp-$LIBWEBP.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a $SDL.tar.gz
|
||||
13388fabb361de768ecdf2b65e52bb27d1054cae6ccb6942ba926e378e00db03 $SDL.tar.gz
|
||||
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
|
||||
012043ce6d411e6e8a91fdc4e05e6bedcfa10fcb1347d3c33908f7fdd10dfe05 qtbase-everywhere-src-$QT.tar.xz
|
||||
d2a1bbb84707b8a0aec29227b170be00f04383fbf2361943596d09e7e443c8e1 qtimageformats-everywhere-src-$QT.tar.xz
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://libsdl.org/release/SDL3-3.2.6.tar.gz",
|
||||
"sha256": "096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a"
|
||||
"url": "https://libsdl.org/release/SDL3-3.2.8.tar.gz",
|
||||
"sha256": "13388fabb361de768ecdf2b65e52bb27d1054cae6ccb6942ba926e378e00db03"
|
||||
}
|
||||
],
|
||||
"cleanup": [
|
||||
|
||||
@@ -40,7 +40,7 @@ fi
|
||||
|
||||
FREETYPE=2.13.3
|
||||
HARFBUZZ=10.0.1
|
||||
SDL=SDL3-3.2.6
|
||||
SDL=SDL3-3.2.8
|
||||
ZSTD=1.5.7
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
LIBPNG=1.6.45
|
||||
@@ -76,7 +76,7 @@ CMAKE_ARCH_UNIVERSAL=-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
|
||||
cat > SHASUMS <<EOF
|
||||
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
|
||||
e7358ea86fe10fb9261931af6f010d4358dac64f7074420ca9bc94aae2bdd542 harfbuzz-$HARFBUZZ.tar.gz
|
||||
096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a $SDL.tar.gz
|
||||
13388fabb361de768ecdf2b65e52bb27d1054cae6ccb6942ba926e378e00db03 $SDL.tar.gz
|
||||
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
926485350139ffb51ef69760db35f78846c805fef3d59bfdcb2fba704663f370 libpng-$LIBPNG.tar.xz
|
||||
|
||||
@@ -22,7 +22,7 @@ fi
|
||||
|
||||
FREETYPE=2.13.3
|
||||
HARFBUZZ=10.0.1
|
||||
SDL=SDL3-3.2.6
|
||||
SDL=SDL3-3.2.8
|
||||
ZSTD=1.5.7
|
||||
LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
LIBPNG=1.6.45
|
||||
@@ -56,7 +56,7 @@ CMAKE_COMMON=(
|
||||
cat > SHASUMS <<EOF
|
||||
0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 freetype-$FREETYPE.tar.xz
|
||||
e7358ea86fe10fb9261931af6f010d4358dac64f7074420ca9bc94aae2bdd542 harfbuzz-$HARFBUZZ.tar.gz
|
||||
096a0b843dd1124afda41c24bd05034af75af37e9a1b9d205cc0a70193b27e1a $SDL.tar.gz
|
||||
13388fabb361de768ecdf2b65e52bb27d1054cae6ccb6942ba926e378e00db03 $SDL.tar.gz
|
||||
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-$ZSTD.tar.gz
|
||||
0728800155f3ed0a0c87e03addbd30ecbe374f7b080678bbca1506051d50dec3 $LZ4.tar.gz
|
||||
926485350139ffb51ef69760db35f78846c805fef3d59bfdcb2fba704663f370 libpng-$LIBPNG.tar.xz
|
||||
|
||||
@@ -49,7 +49,7 @@ set LIBPNG=1645
|
||||
set LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
set QT=6.8.2
|
||||
set QTMINOR=6.8
|
||||
set SDL=SDL3-3.2.6
|
||||
set SDL=SDL3-3.2.8
|
||||
set WEBP=1.5.0
|
||||
set ZLIB=1.3.1
|
||||
set ZLIBSHORT=131
|
||||
@@ -66,7 +66,7 @@ call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lp
|
||||
call :downloadfile "jpegsr%LIBJPEG%.zip" https://ijg.org/files/jpegsr%LIBJPEG%.zip 6255da8c89e09d694e6800688c76145eb6870a76ac0d36c74fccd61b3940aafa || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/%LZ4%.zip" 0c33119688d6b180c7e760b0acd70059222389cfd581632623784bee27e51a31 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 665e5aa2a613affe099a38d61257ecc5ef4bf38b109d915147aa8b005399d68a || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 7f8ff5c8246db4145301bc122601a5f8cef25ee2c326eddb3e88668849c61ddf || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 44087aec0caa4aa81437e787917d29d97536484a682a5d51ec035878e57c0b5c || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 83c72b5dfad04854acf61d592e3f9cdc2ed894779aab8d0470d966715266caaf || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 144d55e4d199793a76c53f19872633a79aec0314039f6f99b6a10b5be7a78fbf || goto error
|
||||
|
||||
@@ -47,7 +47,7 @@ set LIBPNG=1645
|
||||
set LZ4=b8fd2d15309dd4e605070bd4486e26b6ef814e29
|
||||
set QT=6.8.2
|
||||
set QTMINOR=6.8
|
||||
set SDL=SDL3-3.2.6
|
||||
set SDL=SDL3-3.2.8
|
||||
set WEBP=1.5.0
|
||||
set ZLIB=1.3.1
|
||||
set ZLIBSHORT=131
|
||||
@@ -64,7 +64,7 @@ call :downloadfile "lpng%LIBPNG%.zip" https://download.sourceforge.net/libpng/lp
|
||||
call :downloadfile "jpegsr%LIBJPEG%.zip" https://ijg.org/files/jpegsr%LIBJPEG%.zip 6255da8c89e09d694e6800688c76145eb6870a76ac0d36c74fccd61b3940aafa || goto error
|
||||
call :downloadfile "libwebp-%WEBP%.tar.gz" "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-%WEBP%.tar.gz" 7d6fab70cf844bf6769077bd5d7a74893f8ffd4dfb42861745750c63c2a5c92c || goto error
|
||||
call :downloadfile "lz4-%LZ4%.zip" "https://github.com/lz4/lz4/archive/%LZ4%.zip" 0c33119688d6b180c7e760b0acd70059222389cfd581632623784bee27e51a31 || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 665e5aa2a613affe099a38d61257ecc5ef4bf38b109d915147aa8b005399d68a || goto error
|
||||
call :downloadfile "%SDL%.zip" "https://libsdl.org/release/%SDL%.zip" 7f8ff5c8246db4145301bc122601a5f8cef25ee2c326eddb3e88668849c61ddf || goto error
|
||||
call :downloadfile "qtbase-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtbase-everywhere-src-%QT%.zip" 44087aec0caa4aa81437e787917d29d97536484a682a5d51ec035878e57c0b5c || goto error
|
||||
call :downloadfile "qtimageformats-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtimageformats-everywhere-src-%QT%.zip" 83c72b5dfad04854acf61d592e3f9cdc2ed894779aab8d0470d966715266caaf || goto error
|
||||
call :downloadfile "qtsvg-everywhere-src-%QT%.zip" "https://download.qt.io/official_releases/qt/%QTMINOR%/%QT%/submodules/qtsvg-everywhere-src-%QT%.zip" 144d55e4d199793a76c53f19872633a79aec0314039f6f99b6a10b5be7a78fbf || goto error
|
||||
|
||||
21
.github/workflows/windows_build_qt.yml
vendored
21
.github/workflows/windows_build_qt.yml
vendored
@@ -167,8 +167,27 @@ jobs:
|
||||
!./bin/**/*.pdb
|
||||
!./bin/**/*.lib
|
||||
|
||||
- name: Install the Breakpad Symbol Generator
|
||||
uses: baptiste0928/cargo-install@v3
|
||||
with:
|
||||
crate: dump_syms
|
||||
|
||||
- name: Generate Breakpad Symbols # Also flatten pdbs to a 'symbols' directory for upload-artifact
|
||||
shell: pwsh
|
||||
run: |
|
||||
mkdir -Force symbols
|
||||
Get-ChildItem -Path ./bin -Recurse -File | Where-Object {
|
||||
($_.Extension -eq ".exe" -or $_.Extension -eq ".pdb") -and ($_.Name -notmatch "updater")
|
||||
} | ForEach-Object {
|
||||
& dump_syms $_.FullName >> symbols/pcsx2-qt.bpsym
|
||||
}
|
||||
Get-ChildItem -Path ./bin -Recurse -Filter "*.pdb" | ForEach-Object {
|
||||
Copy-Item $_.FullName -Destination symbols/
|
||||
}
|
||||
|
||||
- name: Upload artifact - with symbols
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.artifact-metadata.outputs.artifact-name }}-symbols
|
||||
path: ./bin/**/*.pdb
|
||||
path: |
|
||||
./symbols
|
||||
|
||||
@@ -288,8 +288,14 @@ std::string Path::RealPath(const std::string_view path)
|
||||
{
|
||||
// Resolve non-absolute paths first.
|
||||
std::vector<std::string_view> components;
|
||||
// We need to keep the full combined path in scope
|
||||
// as SplitNativePath() returns string_views to it.
|
||||
std::string buf;
|
||||
if (!IsAbsolute(path))
|
||||
components = Path::SplitNativePath(Path::Combine(FileSystem::GetWorkingDirectory(), path));
|
||||
{
|
||||
buf = Path::Combine(FileSystem::GetWorkingDirectory(), path);
|
||||
components = Path::SplitNativePath(buf);
|
||||
}
|
||||
else
|
||||
components = Path::SplitNativePath(path);
|
||||
|
||||
@@ -968,7 +974,7 @@ std::FILE* FileSystem::OpenCFile(const char* filename, const char* mode, Error*
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const std::wstring wfilename = GetWin32Path(filename);
|
||||
const std::wstring wmode = GetWin32Path(mode);
|
||||
const std::wstring wmode = StringUtil::UTF8StringToWideString(mode);
|
||||
if (!wfilename.empty() && !wmode.empty())
|
||||
{
|
||||
std::FILE* fp;
|
||||
@@ -1060,7 +1066,7 @@ std::FILE* FileSystem::OpenSharedCFile(const char* filename, const char* mode, F
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const std::wstring wfilename = GetWin32Path(filename);
|
||||
const std::wstring wmode = GetWin32Path(mode);
|
||||
const std::wstring wmode = StringUtil::UTF8StringToWideString(mode);
|
||||
if (wfilename.empty() || wmode.empty())
|
||||
return nullptr;
|
||||
|
||||
|
||||
@@ -169,6 +169,12 @@ void Host::SetDefaultUISettings(SettingsInterface& si)
|
||||
// nothing
|
||||
}
|
||||
|
||||
bool Host::LocaleCircleConfirm()
|
||||
{
|
||||
// not running any UI, so no settings requests will come in
|
||||
return false;
|
||||
}
|
||||
|
||||
std::unique_ptr<ProgressCallback> Host::CreateHostProgressCallback()
|
||||
{
|
||||
return ProgressCallback::CreateNullProgressCallback();
|
||||
|
||||
@@ -375,7 +375,7 @@ void InputBindingDialog::ReloadBindNames()
|
||||
{
|
||||
m_bindings_ui.clear();
|
||||
m_bindings_ui.reserve(m_bindings_settings.size());
|
||||
for (int i = 0; i < m_bindings_settings.size(); i++)
|
||||
for (size_t i = 0; i < m_bindings_settings.size(); i++)
|
||||
{
|
||||
SmallString binding{std::string_view{m_bindings_settings[i]}};
|
||||
InputManager::PrettifyInputBinding(binding, false);
|
||||
|
||||
@@ -264,7 +264,7 @@ void InputBindingWidget::reloadBinding()
|
||||
|
||||
m_bindings_ui.clear();
|
||||
m_bindings_ui.reserve(m_bindings_settings.size());
|
||||
for (int i = 0; i < m_bindings_settings.size(); i++)
|
||||
for (size_t i = 0; i < m_bindings_settings.size(); i++)
|
||||
{
|
||||
SmallString binding{std::string_view{m_bindings_settings[i]}};
|
||||
InputManager::PrettifyInputBinding(binding, false);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4205,14 +4205,14 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
const bool AA1 = PRIM->AA1 && (m_vt.m_primclass == GS_LINE_CLASS || m_vt.m_primclass == GS_TRIANGLE_CLASS);
|
||||
// PABE: Check condition early as an optimization, no blending when As < 128.
|
||||
// For Cs*As + Cd*(1 - As) if As is 128 then blending can be disabled as well.
|
||||
const bool PABE = PRIM->ABE && m_draw_env->PABE.PABE &&
|
||||
const bool PABE_skip = PRIM->ABE && m_draw_env->PABE.PABE &&
|
||||
((GetAlphaMinMax().max < 128) || (GetAlphaMinMax().max == 128 && ALPHA.A == 0 && ALPHA.B == 1 && ALPHA.C == 0 && ALPHA.D == 1));
|
||||
// FBMASK: Color is not written, no need to do blending.
|
||||
const u32 temp_fbmask = m_conf.ps.dst_fmt == GSLocalMemory::PSM_FMT_16 ? 0x00F8F8F8 : 0x00FFFFFF;
|
||||
const bool FBMASK = (m_cached_ctx.FRAME.FBMSK & temp_fbmask) == temp_fbmask;
|
||||
const bool FBMASK_skip = (m_cached_ctx.FRAME.FBMSK & temp_fbmask) == temp_fbmask;
|
||||
|
||||
// No blending or coverage anti-aliasing so early exit
|
||||
if (FBMASK || PABE || !(PRIM->ABE || AA1))
|
||||
if (FBMASK_skip || PABE_skip || !(PRIM->ABE || AA1))
|
||||
{
|
||||
m_conf.blend = {};
|
||||
m_conf.ps.no_color1 = true;
|
||||
@@ -4374,11 +4374,14 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// HW blend can handle Cd output.
|
||||
bool color_dest_blend = !!(blend_flag & BLEND_CD);
|
||||
|
||||
// Per pixel alpha blending.
|
||||
const bool PABE = m_draw_env->PABE.PABE && GetAlphaMinMax().min < 128;
|
||||
|
||||
// HW blend can handle it, no need for sw or hdr colclip, Cd*Alpha or Cd*(1 - Alpha) where Alpha <= 128.
|
||||
bool color_dest_blend2 = !m_draw_env->PABE.PABE && ((m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 2 && m_conf.ps.blend_d == 2) || (m_conf.ps.blend_a == 2 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1)) &&
|
||||
bool color_dest_blend2 = !PABE && ((m_conf.ps.blend_a == 1 && m_conf.ps.blend_b == 2 && m_conf.ps.blend_d == 2) || (m_conf.ps.blend_a == 2 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1)) &&
|
||||
(alpha_eq_less_one || (alpha_c1_eq_less_max_one && new_rt_alpha_scale));
|
||||
// HW blend can handle it, no need for sw or hdr colclip, Cs*Alpha + Cd*(1 - Alpha) or Cd*Alpha + Cs*(1 - Alpha) where Alpha <= 128.
|
||||
bool blend_zero_to_one_range = !m_draw_env->PABE.PABE && ((m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1) || (blend_flag & BLEND_MIX3)) &&
|
||||
bool blend_zero_to_one_range = !PABE && ((m_conf.ps.blend_a == 0 && m_conf.ps.blend_b == 1 && m_conf.ps.blend_d == 1) || (blend_flag & BLEND_MIX3)) &&
|
||||
(alpha_eq_less_one || (alpha_c1_eq_less_max_one && new_rt_alpha_scale));
|
||||
|
||||
// Do the multiplication in shader for blending accumulation: Cs*As + Cd or Cs*Af + Cd
|
||||
@@ -4597,7 +4600,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
}
|
||||
|
||||
// Per pixel alpha blending
|
||||
if (m_draw_env->PABE.PABE && GetAlphaMinMax().min < 128)
|
||||
if (PABE)
|
||||
{
|
||||
// Breath of Fire Dragon Quarter, Strawberry Shortcake, Super Robot Wars, Cartoon Network Racing, Simple 2000 Series Vol.81, SOTC.
|
||||
|
||||
@@ -4627,7 +4630,7 @@ void GSRendererHW::EmulateBlending(int rt_alpha_min, int rt_alpha_max, const boo
|
||||
// HDR mode should be disabled when doing sw blend, swap with sw colclip.
|
||||
if (m_conf.ps.hdr)
|
||||
{
|
||||
bool has_HDR_texture = g_gs_device->GetHDRTexture() != nullptr;
|
||||
const bool has_HDR_texture = g_gs_device->GetHDRTexture() != nullptr;
|
||||
m_conf.ps.hdr = 0;
|
||||
m_conf.ps.colclip = 1;
|
||||
m_conf.hdr_mode = has_HDR_texture ? GSHWDrawConfig::HDRMode::EarlyResolve : GSHWDrawConfig::HDRMode::NoModify;
|
||||
@@ -6490,7 +6493,7 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
|
||||
|
||||
if (ate_second_pass)
|
||||
{
|
||||
pxAssert(!env.PABE.PABE);
|
||||
pxAssert(!m_conf.ps.pabe);
|
||||
|
||||
std::memcpy(&m_conf.alpha_second_pass.ps, &m_conf.ps, sizeof(m_conf.ps));
|
||||
std::memcpy(&m_conf.alpha_second_pass.colormask, &m_conf.colormask, sizeof(m_conf.colormask));
|
||||
|
||||
@@ -284,11 +284,13 @@ TinyString InputManager::ConvertKeyboardKeyToString(InputBindingKey key, bool di
|
||||
{
|
||||
const std::optional<std::string> str(ConvertHostKeyboardCodeToString(key.data));
|
||||
if (str.has_value() && !str->empty())
|
||||
{
|
||||
if (display)
|
||||
// Keyboard keys arn't spaced out for display yet
|
||||
ret.format("Keyboard {}", str->c_str());
|
||||
else
|
||||
ret.format("Keyboard/{}", str->c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -320,7 +322,7 @@ TinyString InputManager::ConvertPointerKeyToString(InputBindingKey key, bool dis
|
||||
else if (key.source_subtype == InputSubclass::PointerAxis)
|
||||
{
|
||||
if (display)
|
||||
ret.format("Pointer-{} {}{:c}", u32{key.source_index}, s_pointer_axis_setting_names[key.data],
|
||||
ret.format("Pointer-{} {}{:c}", u32{key.source_index}, s_pointer_axis_names[key.data],
|
||||
key.modifier == InputModifier::Negate ? '-' : '+');
|
||||
else
|
||||
ret.format("Pointer-{}/{}{:c}", u32{key.source_index}, s_pointer_axis_setting_names[key.data],
|
||||
@@ -608,7 +610,7 @@ void InputManager::AddBindings(const std::vector<std::string>& bindings, const I
|
||||
std::vector<std::string> new_bindings;
|
||||
new_bindings.reserve(bindings.size());
|
||||
|
||||
for (int i = 0; i < bindings.size(); i++)
|
||||
for (size_t i = 0; i < bindings.size(); i++)
|
||||
{
|
||||
if (ibindings[i])
|
||||
new_bindings.push_back(ConvertInputBindingKeysToString(binding_type, ibindings[i]->keys, ibindings[i]->num_keys, true));
|
||||
@@ -627,7 +629,7 @@ void InputManager::AddBindings(const std::vector<std::string>& bindings, const I
|
||||
{
|
||||
// LayeredSettingsInterface, Need to find which layer our binding came from
|
||||
LayeredSettingsInterface& lsi = static_cast<LayeredSettingsInterface&>(si);
|
||||
for (int i = 0; i < LayeredSettingsInterface::NUM_LAYERS; i++)
|
||||
for (u32 i = 0; i < LayeredSettingsInterface::NUM_LAYERS; i++)
|
||||
{
|
||||
SettingsInterface* layer = lsi.GetLayer(static_cast<LayeredSettingsInterface::Layer>(i));
|
||||
if (layer && layer->GetStringList(section, key) == bindings)
|
||||
|
||||
@@ -1047,15 +1047,15 @@ bool SDLInputSource::ProcessSDLEvent(const SDL_Event* event)
|
||||
{
|
||||
case SDL_EVENT_GAMEPAD_ADDED:
|
||||
{
|
||||
Console.WriteLn("SDLInputSource: Gamepad %d inserted", event->cdevice.which);
|
||||
OpenDevice(event->cdevice.which, true);
|
||||
Console.WriteLn("SDLInputSource: Gamepad %d inserted", event->gdevice.which);
|
||||
OpenDevice(event->gdevice.which, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
case SDL_EVENT_GAMEPAD_REMOVED:
|
||||
{
|
||||
Console.WriteLn("SDLInputSource: Gamepad %d removed", event->cdevice.which);
|
||||
CloseDevice(event->cdevice.which);
|
||||
Console.WriteLn("SDLInputSource: Gamepad %d removed", event->gdevice.which);
|
||||
CloseDevice(event->gdevice.which);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1066,18 +1066,18 @@ bool SDLInputSource::ProcessSDLEvent(const SDL_Event* event)
|
||||
return false;
|
||||
|
||||
Console.WriteLn("SDLInputSource: Joystick %d inserted", event->jdevice.which);
|
||||
OpenDevice(event->cdevice.which, false);
|
||||
OpenDevice(event->jdevice.which, false);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case SDL_EVENT_JOYSTICK_REMOVED:
|
||||
{
|
||||
if (auto it = GetControllerDataForJoystickId(event->cdevice.which); it != m_controllers.end() && it->gamepad)
|
||||
if (auto it = GetControllerDataForJoystickId(event->jdevice.which); it != m_controllers.end() && it->gamepad)
|
||||
return false;
|
||||
|
||||
Console.WriteLn("SDLInputSource: Joystick %d removed", event->jdevice.which);
|
||||
CloseDevice(event->cdevice.which);
|
||||
CloseDevice(event->jdevice.which);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1119,7 +1119,7 @@ SDL_Joystick* SDLInputSource::GetJoystickForDevice(const std::string_view device
|
||||
return it->joystick;
|
||||
}
|
||||
|
||||
SDLInputSource::ControllerDataVector::iterator SDLInputSource::GetControllerDataForJoystickId(int id)
|
||||
SDLInputSource::ControllerDataVector::iterator SDLInputSource::GetControllerDataForJoystickId(SDL_JoystickID id)
|
||||
{
|
||||
return std::find_if(m_controllers.begin(), m_controllers.end(), [id](const ControllerData& cd) { return cd.joystick_id == id; });
|
||||
}
|
||||
@@ -1146,7 +1146,7 @@ int SDLInputSource::GetFreePlayerId() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SDLInputSource::OpenDevice(int index, bool is_gamepad)
|
||||
bool SDLInputSource::OpenDevice(SDL_JoystickID index, bool is_gamepad)
|
||||
{
|
||||
SDL_Gamepad* gamepad;
|
||||
SDL_Joystick* joystick;
|
||||
@@ -1327,7 +1327,7 @@ bool SDLInputSource::OpenDevice(int index, bool is_gamepad)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDLInputSource::CloseDevice(int joystick_index)
|
||||
bool SDLInputSource::CloseDevice(SDL_JoystickID joystick_index)
|
||||
{
|
||||
auto it = GetControllerDataForJoystickId(joystick_index);
|
||||
if (it == m_controllers.end())
|
||||
|
||||
@@ -74,12 +74,12 @@ private:
|
||||
void LoadSettings(SettingsInterface& si);
|
||||
void SetHints();
|
||||
|
||||
ControllerDataVector::iterator GetControllerDataForJoystickId(int id);
|
||||
ControllerDataVector::iterator GetControllerDataForJoystickId(SDL_JoystickID id);
|
||||
ControllerDataVector::iterator GetControllerDataForPlayerId(int id);
|
||||
int GetFreePlayerId() const;
|
||||
|
||||
bool OpenDevice(int index, bool is_gamepad);
|
||||
bool CloseDevice(int joystick_index);
|
||||
bool OpenDevice(SDL_JoystickID index, bool is_gamepad);
|
||||
bool CloseDevice(SDL_JoystickID joystick_index);
|
||||
bool HandleGamepadAxisEvent(const SDL_GamepadAxisEvent* ev);
|
||||
bool HandleGamepadButtonEvent(const SDL_GamepadButtonEvent* ev);
|
||||
bool HandleJoystickAxisEvent(const SDL_JoyAxisEvent* ev);
|
||||
|
||||
@@ -11,4 +11,9 @@
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
<ws2:longPathAware>true</ws2:longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
|
||||
Reference in New Issue
Block a user