mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge X11+D3D FreeLook feature into DolphinWX
This removes the redundant code and also implements this feature for OSX and Wayland. But so it's dropped for non-wx builds... imo DolphinWX still isn't the best place for this, but now it's in the same file as all other hotkeys. Maybe they'll be moved to InputCommon sometimes at once ...
This commit is contained in:
@ -7,7 +7,6 @@
|
||||
#include "VideoConfig.h"
|
||||
#include "EmuWindow.h"
|
||||
#include "Fifo.h"
|
||||
#include "VertexShaderManager.h"
|
||||
#include "VideoBackendBase.h"
|
||||
#include "Core.h"
|
||||
#include "Host.h"
|
||||
@ -41,60 +40,8 @@ HWND GetParentWnd()
|
||||
return m_hParent;
|
||||
}
|
||||
|
||||
void FreeLookInput( UINT iMsg, WPARAM wParam )
|
||||
{
|
||||
static bool mouseLookEnabled = false;
|
||||
static bool mouseMoveEnabled = false;
|
||||
static float lastMouse[2];
|
||||
POINT point;
|
||||
|
||||
switch(iMsg)
|
||||
{
|
||||
case WM_MOUSEMOVE:
|
||||
if (mouseLookEnabled)
|
||||
{
|
||||
GetCursorPos(&point);
|
||||
VertexShaderManager::RotateView((point.x - lastMouse[0]) / 200.0f, (point.y - lastMouse[1]) / 200.0f);
|
||||
lastMouse[0] = (float)point.x;
|
||||
lastMouse[1] = (float)point.y;
|
||||
}
|
||||
|
||||
if (mouseMoveEnabled)
|
||||
{
|
||||
GetCursorPos(&point);
|
||||
VertexShaderManager::TranslateView((point.x - lastMouse[0]) / 50.0f, (point.y - lastMouse[1]) / 50.0f);
|
||||
lastMouse[0] = (float)point.x;
|
||||
lastMouse[1] = (float)point.y;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_RBUTTONDOWN:
|
||||
GetCursorPos(&point);
|
||||
lastMouse[0] = (float)point.x;
|
||||
lastMouse[1] = (float)point.y;
|
||||
mouseLookEnabled= true;
|
||||
break;
|
||||
case WM_MBUTTONDOWN:
|
||||
GetCursorPos(&point);
|
||||
lastMouse[0] = (float)point.x;
|
||||
lastMouse[1] = (float)point.y;
|
||||
mouseMoveEnabled= true;
|
||||
break;
|
||||
case WM_RBUTTONUP:
|
||||
mouseLookEnabled = false;
|
||||
break;
|
||||
case WM_MBUTTONUP:
|
||||
mouseMoveEnabled = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
if (g_ActiveConfig.bFreeLook)
|
||||
FreeLookInput( iMsg, wParam );
|
||||
|
||||
switch( iMsg )
|
||||
{
|
||||
case WM_PAINT:
|
||||
|
Reference in New Issue
Block a user