mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-15 02:05:46 -04:00
GPUDevice: Remove mouse pointer position
This commit is contained in:
@ -244,7 +244,7 @@ bool DisplayWidget::event(QEvent* event)
|
||||
|
||||
const float scaled_x = static_cast<float>(static_cast<qreal>(mouse_pos.x()) * dpr);
|
||||
const float scaled_y = static_cast<float>(static_cast<qreal>(mouse_pos.y()) * dpr);
|
||||
emit windowMouseMoveEvent(false, scaled_x, scaled_y);
|
||||
InputManager::UpdatePointerAbsolutePosition(0, scaled_x, scaled_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -270,8 +270,10 @@ bool DisplayWidget::event(QEvent* event)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dx != 0.0f || dy != 0.0f)
|
||||
emit windowMouseMoveEvent(true, dx, dy);
|
||||
if (dx != 0.0f)
|
||||
InputManager::UpdatePointerRelativeDelta(0, InputPointerAxis::X, dx);
|
||||
if (dy != 0.0f)
|
||||
InputManager::UpdatePointerRelativeDelta(0, InputPointerAxis::Y, dy);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -38,7 +38,6 @@ Q_SIGNALS:
|
||||
void windowRestoredEvent();
|
||||
void windowKeyEvent(int key_code, bool pressed);
|
||||
void windowTextEntered(const QString& text);
|
||||
void windowMouseMoveEvent(bool relative, float x, float y);
|
||||
void windowMouseButtonEvent(int button, bool pressed);
|
||||
void windowMouseWheelEvent(const QPoint& angle_delta);
|
||||
|
||||
|
@ -568,35 +568,6 @@ void EmuThread::onDisplayWindowTextEntered(const QString& text)
|
||||
ImGuiManager::AddTextInput(text.toStdString());
|
||||
}
|
||||
|
||||
void EmuThread::onDisplayWindowMouseMoveEvent(bool relative, float x, float y)
|
||||
{
|
||||
// display might be null here if the event happened after shutdown
|
||||
DebugAssert(isOnThread());
|
||||
if (!relative)
|
||||
{
|
||||
if (g_gpu_device)
|
||||
g_gpu_device->SetMousePosition(static_cast<s32>(x), static_cast<s32>(y));
|
||||
|
||||
InputManager::UpdatePointerAbsolutePosition(0, x, y);
|
||||
ImGuiManager::UpdateMousePosition(x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x != 0.0f)
|
||||
InputManager::UpdatePointerRelativeDelta(0, InputPointerAxis::X, x);
|
||||
if (y != 0.0f)
|
||||
InputManager::UpdatePointerRelativeDelta(0, InputPointerAxis::Y, y);
|
||||
|
||||
if (g_gpu_device)
|
||||
{
|
||||
const float abs_x = static_cast<float>(g_gpu_device->GetMousePositionX()) + x;
|
||||
const float abs_y = static_cast<float>(g_gpu_device->GetMousePositionY()) + y;
|
||||
g_gpu_device->SetMousePosition(static_cast<s32>(abs_x), static_cast<s32>(abs_y));
|
||||
ImGuiManager::UpdateMousePosition(abs_x, abs_y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EmuThread::onDisplayWindowMouseButtonEvent(int button, bool pressed)
|
||||
{
|
||||
DebugAssert(isOnThread());
|
||||
@ -733,7 +704,6 @@ void EmuThread::connectDisplaySignals(DisplayWidget* widget)
|
||||
connect(widget, &DisplayWidget::windowRestoredEvent, this, &EmuThread::redrawDisplayWindow);
|
||||
connect(widget, &DisplayWidget::windowKeyEvent, this, &EmuThread::onDisplayWindowKeyEvent);
|
||||
connect(widget, &DisplayWidget::windowTextEntered, this, &EmuThread::onDisplayWindowTextEntered);
|
||||
connect(widget, &DisplayWidget::windowMouseMoveEvent, this, &EmuThread::onDisplayWindowMouseMoveEvent);
|
||||
connect(widget, &DisplayWidget::windowMouseButtonEvent, this, &EmuThread::onDisplayWindowMouseButtonEvent);
|
||||
connect(widget, &DisplayWidget::windowMouseWheelEvent, this, &EmuThread::onDisplayWindowMouseWheelEvent);
|
||||
}
|
||||
|
@ -192,7 +192,6 @@ public Q_SLOTS:
|
||||
|
||||
private Q_SLOTS:
|
||||
void stopInThread();
|
||||
void onDisplayWindowMouseMoveEvent(bool relative, float x, float y);
|
||||
void onDisplayWindowMouseButtonEvent(int button, bool pressed);
|
||||
void onDisplayWindowMouseWheelEvent(const QPoint& delta_angle);
|
||||
void onDisplayWindowResized(int width, int height, float scale);
|
||||
|
Reference in New Issue
Block a user