mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(WINRAW) Cleanups
This commit is contained in:
parent
079070daf7
commit
6170fc45ae
@ -363,9 +363,9 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
|
||||
if (!EqualRect(&wr->active_rect, &wr->prev_rect))
|
||||
{
|
||||
if (wr->rect_delay < 10 )
|
||||
if (wr->rect_delay < 10)
|
||||
{
|
||||
RARCH_LOG("[CRT][WINRAW]: Resize RECT delay for absolute co-ords - %d \n", wr->rect_delay);
|
||||
RARCH_DBG("[CRT][WINRAW]: Resize RECT delay for absolute co-ords - %d \n", wr->rect_delay);
|
||||
winraw_init_mouse_xy_mapping(wr); /* Triggering fewer times seems to fix the issue. Forcing resize while resolution is changing */
|
||||
wr->rect_delay ++;
|
||||
}
|
||||
@ -373,7 +373,7 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
{
|
||||
int bottom = wr->prev_rect.bottom;
|
||||
int right = wr->prev_rect.right;
|
||||
RARCH_LOG("[CRT][WINRAW]: Resizing RECT for absolute coordinates to match new resolution - %dx%d\n", right ,bottom);
|
||||
RARCH_DBG("[CRT][WINRAW]: Resizing RECT for absolute coordinates to match new resolution - %dx%d\n", right ,bottom);
|
||||
wr->active_rect = wr->prev_rect;
|
||||
winraw_init_mouse_xy_mapping(wr);
|
||||
wr->rect_delay = 0;
|
||||
@ -399,19 +399,10 @@ static void winraw_update_mouse_state(winraw_input_t *wr,
|
||||
InterlockedExchangeAdd(&mouse->dlt_x, state->lLastX);
|
||||
InterlockedExchangeAdd(&mouse->dlt_y, state->lLastY);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (!GetCursorPos(&crs_pos))
|
||||
{
|
||||
RARCH_WARN("[WINRAW]: GetCursorPos failed with error %lu.\n", GetLastError());
|
||||
}
|
||||
RARCH_DBG("[WINRAW]: GetCursorPos failed with error %lu.\n", GetLastError());
|
||||
else if (!ScreenToClient((HWND)video_driver_window_get(), &crs_pos))
|
||||
{
|
||||
RARCH_WARN("[WINRAW]: ScreenToClient failed with error %lu.\n", GetLastError());
|
||||
}
|
||||
#else
|
||||
if (!GetCursorPos(&crs_pos)) { }
|
||||
else if (!ScreenToClient((HWND)video_driver_window_get(), &crs_pos)) { }
|
||||
#endif
|
||||
RARCH_DBG("[WINRAW]: ScreenToClient failed with error %lu.\n", GetLastError());
|
||||
else
|
||||
{
|
||||
mouse->x = crs_pos.x;
|
||||
@ -894,7 +885,7 @@ static int16_t winraw_input_state(
|
||||
}
|
||||
break;
|
||||
case RETRO_DEVICE_LIGHTGUN:
|
||||
switch ( id )
|
||||
switch (id)
|
||||
{
|
||||
/*aiming*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_SCREEN_X:
|
||||
@ -903,7 +894,7 @@ static int16_t winraw_input_state(
|
||||
if (mouse)
|
||||
return winraw_lightgun_aiming_state(wr, mouse, port, id);
|
||||
break;
|
||||
/*buttons*/
|
||||
/*buttons*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_TRIGGER:
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_RELOAD:
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_AUX_A:
|
||||
@ -939,7 +930,7 @@ static int16_t winraw_input_state(
|
||||
joykey,
|
||||
joyaxis);
|
||||
}
|
||||
/*deprecated*/
|
||||
/*deprecated*/
|
||||
case RETRO_DEVICE_ID_LIGHTGUN_X:
|
||||
if (mouse)
|
||||
return mouse->dlt_x;
|
||||
@ -956,13 +947,10 @@ static int16_t winraw_input_state(
|
||||
}
|
||||
|
||||
#if !defined(_XBOX)
|
||||
bool winraw_handle_message(UINT message,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
bool winraw_handle_message(UINT msg,
|
||||
WPARAM wpar, LPARAM lpar)
|
||||
{
|
||||
winraw_input_t *wr = (winraw_input_t*)(LONG_PTR)
|
||||
GetWindowLongPtr(main_window.hwnd, GWLP_USERDATA);
|
||||
|
||||
switch (message)
|
||||
switch (msg)
|
||||
{
|
||||
case WM_SETFOCUS:
|
||||
winraw_focus = true;
|
||||
@ -973,12 +961,12 @@ bool winraw_handle_message(UINT message,
|
||||
|
||||
case WM_DEVICECHANGE:
|
||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0500 /* 2K */
|
||||
if (wParam == DBT_DEVICEARRIVAL ||
|
||||
wParam == DBT_DEVICEREMOVECOMPLETE)
|
||||
if (wpar == DBT_DEVICEARRIVAL ||
|
||||
wpar == DBT_DEVICEREMOVECOMPLETE)
|
||||
{
|
||||
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lParam;
|
||||
PDEV_BROADCAST_HDR pHdr = (PDEV_BROADCAST_HDR)lpar;
|
||||
if (pHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
|
||||
joypad_driver_reinit(wr, NULL);
|
||||
joypad_driver_reinit(NULL, NULL);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user