From ac986c7c613368fdd6686827d09eb51d9794b033 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 15 Aug 2021 18:43:48 +0200 Subject: [PATCH] fix some warnings --- rpcs3/Emu/Cell/Modules/cellGem.cpp | 8 ++++---- rpcs3/Emu/Io/PadHandler.cpp | 2 +- rpcs3/Input/evdev_joystick_handler.cpp | 2 +- rpcs3/Input/keyboard_pad_handler.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGem.cpp b/rpcs3/Emu/Cell/Modules/cellGem.cpp index f6b1673098..1412ae5c20 100644 --- a/rpcs3/Emu/Cell/Modules/cellGem.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGem.cpp @@ -95,8 +95,8 @@ struct gem_config u8 rumble = 0; // Rumble intensity gem_color sphere_rgb = {}; // RGB color of the sphere LED u32 hue = 0; // Tracking hue of the motion controller - u32 distance{1500}; // Distance from the camera in mm - u32 radius{10}; // Radius of the sphere in camera pixels + f32 distance{1500.0f}; // Distance from the camera in mm + f32 radius{10.0f}; // Radius of the sphere in camera pixels bool is_calibrating{false}; // Whether or not we are currently calibrating u64 calibration_start_us{0}; // The start timestamp of the calibration in microseconds @@ -380,7 +380,7 @@ static bool mouse_pos_to_gem_image_state(const u32 mouse_no, const gem_config::g if (mouse_height <= 0) mouse_height = shared_data.height; const f32 scaling_width = mouse_width / static_cast(shared_data.width); const f32 scaling_height = mouse_height / static_cast(shared_data.height); - const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / static_cast(controller.radius); + const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / controller.radius; // Image coordinates in pixels const f32 image_x = static_cast(mouse.x_pos) / scaling_width; @@ -425,7 +425,7 @@ static bool mouse_pos_to_gem_state(const u32 mouse_no, const gem_config::gem_con if (mouse_height <= 0) mouse_height = shared_data.height; const f32 scaling_width = mouse_width / static_cast(shared_data.width); const f32 scaling_height = mouse_height / static_cast(shared_data.height); - const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / static_cast(controller.radius); + const f32 mmPerPixel = CELL_GEM_SPHERE_RADIUS_MM / controller.radius; // Image coordinates in pixels const f32 image_x = static_cast(mouse.x_pos) / scaling_width; diff --git a/rpcs3/Emu/Io/PadHandler.cpp b/rpcs3/Emu/Io/PadHandler.cpp index 894cfdb2d5..8556ba7c84 100644 --- a/rpcs3/Emu/Io/PadHandler.cpp +++ b/rpcs3/Emu/Io/PadHandler.cpp @@ -467,7 +467,7 @@ bool PadHandlerBase::bindPadToDevice(std::shared_ptr pad, const std::string ); pad->m_buttons.emplace_back(special_button_offset, mapping[button::pressure_intensity_button], special_button_value::pressure_intensity); - pad->m_pressure_intensity_button_index = pad->m_buttons.size() - 1; + pad->m_pressure_intensity_button_index = static_cast(pad->m_buttons.size()) - 1; pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, mapping[button::up], CELL_PAD_CTRL_UP); pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, mapping[button::down], CELL_PAD_CTRL_DOWN); diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index f7d971efd9..1bb335aef2 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -963,7 +963,7 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr pad, const std ); pad->m_buttons.emplace_back(special_button_offset, evdevbutton(cfg->pressure_intensity_button).code, special_button_value::pressure_intensity); - pad->m_pressure_intensity_button_index = pad->m_buttons.size() - 1; + pad->m_pressure_intensity_button_index = static_cast(pad->m_buttons.size()) - 1; pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, evdevbutton(cfg->triangle).code, CELL_PAD_CTRL_TRIANGLE); pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL2, evdevbutton(cfg->circle).code, CELL_PAD_CTRL_CIRCLE); diff --git a/rpcs3/Input/keyboard_pad_handler.cpp b/rpcs3/Input/keyboard_pad_handler.cpp index 0f358dbe40..9424c1455b 100644 --- a/rpcs3/Input/keyboard_pad_handler.cpp +++ b/rpcs3/Input/keyboard_pad_handler.cpp @@ -746,7 +746,7 @@ bool keyboard_pad_handler::bindPadToDevice(std::shared_ptr pad, const std:: ); pad->m_buttons.emplace_back(special_button_offset, find_key(cfg->pressure_intensity_button), special_button_value::pressure_intensity); - pad->m_pressure_intensity_button_index = pad->m_buttons.size() - 1; + pad->m_pressure_intensity_button_index = static_cast(pad->m_buttons.size()) - 1; pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(cfg->left), CELL_PAD_CTRL_LEFT); pad->m_buttons.emplace_back(CELL_PAD_BTN_OFFSET_DIGITAL1, find_key(cfg->down), CELL_PAD_CTRL_DOWN);