Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Nov 16, 2024
1 parent 6efe5be commit e55a979
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 27 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 change: 1 addition & 0 deletions 3rdparty/opencv
Submodule opencv added at 3855c5
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions rpcs3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions rpcs3/Emu/Cell/Modules/cellGem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -403,7 +401,8 @@ struct gem_config_data
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);
Expand Down Expand Up @@ -682,7 +681,7 @@ class gem_tracker

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;
}

Expand All @@ -691,15 +690,15 @@ class gem_tracker
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;
}

Expand Down
3 changes: 0 additions & 3 deletions rpcs3/Emu/Io/PadHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions rpcs3/Input/ps_move_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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>;
16 changes: 10 additions & 6 deletions rpcs3/rpcs3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
<ExternalWarningLevel>TurnOffAllWarnings</ExternalWarningLevel>
</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>
<AdditionalDependencies>opencv_core4100.lib;opencv_imgproc4100.lib;opencv_photo4100.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\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>
Expand All @@ -114,7 +114,9 @@
<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_core4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_imgproc4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_photo4100.dll" "$(OutDir)"
</Command>
</PostBuildEvent>
<PostBuildEvent>
Expand All @@ -141,8 +143,8 @@
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</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>
<AdditionalDependencies>opencv_core4100.lib;opencv_imgproc4100.lib;opencv_photo4100.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\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>
Expand All @@ -167,7 +169,9 @@
<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_core4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_imgproc4100.dll" "$(OutDir)"
xcopy /y /d "..\3rdparty\opencv\opencv410\build\x64\bin\opencv_photo4100.dll" "$(OutDir)"
</Command>
</PostBuildEvent>
<PostBuildEvent>
Expand Down
2 changes: 2 additions & 0 deletions rpcs3/rpcs3qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions rpcs3/rpcs3qt/pad_settings_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/ps_move_tracker_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e55a979

Please sign in to comment.