1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

Fix compilation

This commit is contained in:
Megamouse 2024-07-19 22:45:41 +02:00
parent f16dfd8ca2
commit 4df58494a0
13 changed files with 25 additions and 25 deletions

5
.gitignore vendored
View File

@ -127,11 +127,6 @@ yaml-cpp.pc
# miniupnp
/3rdparty/miniupnp/x64/*
# opencv
/3rdparty/opencv/*
!/3rdparty/opencv/opencv410/build/x64/vc16/bin/opencv_world4100.dll
!/3rdparty/opencv/opencv410/build/x64/vc16/lib/opencv_world4100.lib
# llvm
/3rdparty/llvm/llvm_build

4
.gitmodules vendored
View File

@ -96,3 +96,7 @@
path = 3rdparty/stblib/stb
url = ../../nothings/stb.git
ignore = dirty
[submodule "3rdparty/opencv"]
path = 3rdparty/opencv
url = ../../Megamouse/opencv_minimal.git
ignore = dirty

1
3rdparty/opencv vendored Submodule

@ -0,0 +1 @@
Subproject commit f76628fb5b25746fcb75a7ce85be0d8c6439fc57

View File

@ -82,6 +82,9 @@ target_sources(rpcs3
Input/mm_joystick_handler.cpp
Input/pad_thread.cpp
Input/product_info.cpp
Input/ps_move_config.cpp
Input/ps_move_handler.cpp
Input/ps_move_tracker.cpp
Input/raw_mouse_config.cpp
Input/raw_mouse_handler.cpp
Input/sdl_pad_handler.cpp

View File

@ -25,8 +25,6 @@
LOG_CHANNEL(cellGem);
extern u32 get_buffer_size_by_format(s32 format, s32 width, s32 height);
template <>
void fmt_class_string<gem_btn>::format(std::string& out, u64 arg)
{
@ -403,7 +401,8 @@ public:
cellGem.notice("Could not load fake gem config. Using defaults.");
}
cellGem.notice("Gem config=\n", g_cfg_gem.to_string());
cellGem.notice("Real gem config=\n", g_cfg_gem_real.to_string());
cellGem.notice("Fake gem config=\n", g_cfg_gem_fake.to_string());
};
SAVESTATE_INIT_POS(15);
@ -682,7 +681,7 @@ public:
if (m_camera_info.buffer.addr() != addr && m_camera_info.pbuf[0].addr() != addr && m_camera_info.pbuf[1].addr() != addr)
{
cellGem.error("gem_tracker: unexcepted image address: addr=0x%x, expected one of: 0x%x, 0x%x, 0x%x", addr, m_camera_info.buffer.addr(), m_camera_info.pbuf[0].addr(), m_camera_info.pbuf[1].addr());
cellGem.error("gem_tracker: unexpected image address: addr=0x%x, expected one of: 0x%x, 0x%x, 0x%x", addr, m_camera_info.buffer.addr(), m_camera_info.pbuf[0].addr(), m_camera_info.pbuf[1].addr());
return false;
}
@ -691,15 +690,15 @@ public:
const auto& [width, height] = get_video_resolution(m_camera_info);
const u32 expected_size = get_buffer_size_by_format(m_camera_info.format, width, height);
if (!m_camera_info.bytesize || m_camera_info.bytesize != expected_size)
if (!m_camera_info.bytesize || static_cast<u32>(m_camera_info.bytesize) != expected_size)
{
cellGem.error("gem_tracker: unexcepted image size: size=%d, expected=%d", m_camera_info.bytesize, expected_size);
cellGem.error("gem_tracker: unexpected image size: size=%d, expected=%d", m_camera_info.bytesize, expected_size);
return false;
}
if (!m_camera_info.bytesize)
{
cellGem.error("gem_tracker: unexcepted image size: %d", m_camera_info.bytesize);
cellGem.error("gem_tracker: unexpected image size: %d", m_camera_info.bytesize);
return false;
}

View File

@ -252,9 +252,7 @@ PadHandlerBase::connection PadHandlerBase::get_next_button_press(const std::stri
// Keep the pad cached to reduce expensive one time requests
if (!m_pad_for_pad_settings || m_pad_for_pad_settings->m_pad_handler != m_type)
{
const pad_preview_values preview_values{};
m_pad_for_pad_settings = std::make_shared<Pad>(m_type, 0, 0, 0, 0);
m_pad_for_pad_settings->m_sensors.resize(preview_values.size(), AnalogSensor(0, 0, 0, 0, 0));
}
// Get extended device ID
@ -367,7 +365,6 @@ void PadHandlerBase::get_motion_sensors(const std::string& pad_id, const motion_
if (!m_pad_for_pad_settings || m_pad_for_pad_settings->m_pad_handler != m_type)
{
m_pad_for_pad_settings = std::make_shared<Pad>(m_type, 0, 0, 0, 0);
m_pad_for_pad_settings->m_sensors.resize(preview_values.size(), AnalogSensor(0, 0, 0, 0, 0));
}
// Get the current motion values

View File

@ -18,9 +18,6 @@ namespace gem
u8* video_data_out, u32 video_data_out_size);
}
template class ps_move_tracker<false>;
template class ps_move_tracker<true>;
template <bool DiagnosticsEnabled>
ps_move_tracker<DiagnosticsEnabled>::ps_move_tracker()
{
@ -240,8 +237,6 @@ void ps_move_tracker<DiagnosticsEnabled>::process_hues()
const u32 width = m_width;
const u32 height = m_height;
static const double sqrt3 = sqrt(3);
if constexpr (DiagnosticsEnabled)
{
std::fill(m_hues.begin(), m_hues.end(), 0);
@ -562,3 +557,6 @@ std::tuple<s16, float, float> ps_move_tracker<DiagnosticsEnabled>::rgb_to_hsv(fl
return { hue, saturation, cmax };
}
template class ps_move_tracker<false>;
template class ps_move_tracker<true>;

View File

@ -90,7 +90,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>opencv_world4100.lib;DbgHelp.lib;Ole32.lib;gdi32.lib;hidapi.lib;libusb-1.0.lib;winmm.lib;miniupnpc_static.lib;rtmidi.lib;imm32.lib;ksuser.lib;version.lib;OpenAL32.lib;XAudio.lib;GLGSRender.lib;shlwapi.lib;VKGSRender.lib;vulkan-1.lib;wolfssl.lib;libcurl.lib;Wldap32.lib;glslang.lib;OSDependent.lib;OGLCompiler.lib;SPIRV.lib;MachineIndependent.lib;GenericCodeGen.lib;Advapi32.lib;user32.lib;zlib.lib;zstd.lib;libpng16.lib;asmjit.lib;yaml-cpp.lib;discord-rpc.lib;emucore.lib;dxgi.lib;shell32.lib;Qt6Core.lib;Qt6Gui.lib;Qt6Widgets.lib;Qt6Concurrent.lib;Qt6Multimedia.lib;Qt6MultimediaWidgets.lib;Qt6Svg.lib;Qt6SvgWidgets.lib;7zip.lib;libcubeb.lib;cubeb.lib;soundtouch.lib;Avrt.lib;SDL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)3rdparty\opencv\opencv410\build\x64\vc16\lib;$(SolutionDir)3rdparty\openal\openal-soft\build;$(SolutionDir)3rdparty\glslang\build\hlsl\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\SPIRV\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\OGLCompilersDLL\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\OSDependent\Windows\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\$(CONFIGURATION);$(SolutionDir)3rdparty\discord-rpc\lib;$(SolutionDir)lib\$(CONFIGURATION)-$(PLATFORM);$(QTDIR)\lib;$(VULKAN_SDK)\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)3rdparty\opencv\opencv410\build\x64\lib;$(SolutionDir)3rdparty\openal\openal-soft\build;$(SolutionDir)3rdparty\glslang\build\hlsl\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\SPIRV\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\OGLCompilersDLL\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\OSDependent\Windows\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\$(CONFIGURATION);$(SolutionDir)3rdparty\discord-rpc\lib;$(SolutionDir)lib\$(CONFIGURATION)-$(PLATFORM);$(QTDIR)\lib;$(VULKAN_SDK)\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>Debug</GenerateDebugInformation>
@ -114,7 +114,7 @@
<PostBuildEvent>
<Command>
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --release "$(TargetPath)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\vc16\bin\opencv_world4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
</Command>
</PostBuildEvent>
<PostBuildEvent>
@ -142,7 +142,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>opencv_world4100.lib;DbgHelp.lib;Ole32.lib;gdi32.lib;hidapi.lib;libusb-1.0.lib;winmm.lib;miniupnpc_static.lib;rtmidi.lib;imm32.lib;ksuser.lib;version.lib;OpenAL32.lib;XAudio.lib;GLGSRender.lib;shlwapi.lib;VKGSRender.lib;vulkan-1.lib;wolfssl.lib;libcurl.lib;Wldap32.lib;glslangd.lib;OSDependentd.lib;OGLCompilerd.lib;SPIRVd.lib;MachineIndependentd.lib;GenericCodeGend.lib;Advapi32.lib;user32.lib;zlib.lib;zstd.lib;libpng16.lib;asmjit.lib;yaml-cpp.lib;discord-rpc.lib;emucore.lib;dxgi.lib;shell32.lib;Qt6Cored.lib;Qt6Guid.lib;Qt6Widgetsd.lib;Qt6Concurrentd.lib;Qt6Multimediad.lib;Qt6MultimediaWidgetsd.lib;Qt6Svgd.lib;Qt6SvgWidgetsd.lib;7zip.lib;libcubeb.lib;cubeb.lib;soundtouch.lib;Avrt.lib;SDL.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)3rdparty\opencv\opencv410\build\x64\vc16\lib;$(SolutionDir)3rdparty\openal\openal-soft\build;$(SolutionDir)3rdparty\glslang\build\hlsl\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\SPIRV\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\OGLCompilersDLL\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\OSDependent\Windows\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\$(CONFIGURATION);$(SolutionDir)3rdparty\discord-rpc\lib;$(SolutionDir)lib\$(CONFIGURATION)-$(PLATFORM);$(QTDIR)\lib;$(VULKAN_SDK)\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)3rdparty\opencv\opencv410\build\x64\lib;$(SolutionDir)3rdparty\openal\openal-soft\build;$(SolutionDir)3rdparty\glslang\build\hlsl\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\SPIRV\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\OGLCompilersDLL\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\OSDependent\Windows\$(CONFIGURATION);$(SolutionDir)3rdparty\glslang\build\glslang\$(CONFIGURATION);$(SolutionDir)3rdparty\discord-rpc\lib;$(SolutionDir)lib\$(CONFIGURATION)-$(PLATFORM);$(QTDIR)\lib;$(VULKAN_SDK)\Lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /VERBOSE %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>Debug</GenerateDebugInformation>
@ -167,7 +167,7 @@
<PostBuildEvent>
<Command>
$(QTDIR)\bin\windeployqt --no-compiler-runtime --no-opengl-sw --no-patchqt --no-translations --no-quick --no-system-d3d-compiler --no-quick-import --plugindir "$(TargetDir)qt6\plugins" --debug "$(TargetPath)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\vc16\bin\opencv_world4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_world4100.dll" "$(OutDir)"
</Command>
</PostBuildEvent>
<PostBuildEvent>

View File

@ -65,6 +65,7 @@ add_library(rpcs3_ui STATIC
pkg_install_dialog.cpp
progress_dialog.cpp
progress_indicator.cpp
ps_move_tracker_dialog.cpp
qt_camera_handler.cpp
qt_camera_video_sink.cpp
qt_music_handler.cpp
@ -117,6 +118,7 @@ add_library(rpcs3_ui STATIC
pad_settings_dialog.ui
patch_creator_dialog.ui
patch_manager_dialog.ui
ps_move_tracker_dialog.ui
settings_dialog.ui
shortcut_dialog.ui
welcome_dialog.ui

View File

@ -1984,6 +1984,7 @@ QString pad_settings_dialog::GetLocalizedPadName(pad_handler handler, const QStr
case pad_handler::ds4: return tr("DS4 Pad #%0").arg(index);
case pad_handler::dualsense: return tr("DualSense Pad #%0").arg(index);
case pad_handler::skateboard: return tr("Skateboard #%0").arg(index);
case pad_handler::move: return tr("PS Move #%0").arg(index);
#ifdef _WIN32
case pad_handler::xinput: return tr("XInput Pad #%0").arg(index);
case pad_handler::mm: return tr("Joystick #%0").arg(index);

View File

@ -412,7 +412,7 @@ void ps_move_tracker_dialog::process_camera_frame()
{
std::lock_guard camera_lock(m_camera_handler_mutex);
if (!m_camera_handler)
if (!m_camera_handler || m_camera_handler->get_state() == qt_camera_handler::camera_handler_state::closed)
{
// Wait some time
std::this_thread::sleep_for(100us);