mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-05-18 19:02:21 +00:00
Fixed uninitialized variable warning
This commit is contained in:
parent
b2819e43a7
commit
d166f5ef76
|
@ -734,6 +734,9 @@ pointer_handle_frame(void *data, struct wl_pointer *pointer)
|
||||||
case AXIS_EVENT_VALUE120:
|
case AXIS_EVENT_VALUE120:
|
||||||
x = input->pointer_curr_axis_info.x / 120.0f;
|
x = input->pointer_curr_axis_info.x / 120.0f;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
x = 0.0f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(input->pointer_curr_axis_info.y_axis_type) {
|
switch(input->pointer_curr_axis_info.y_axis_type) {
|
||||||
|
@ -746,16 +749,18 @@ pointer_handle_frame(void *data, struct wl_pointer *pointer)
|
||||||
case AXIS_EVENT_VALUE120:
|
case AXIS_EVENT_VALUE120:
|
||||||
y = input->pointer_curr_axis_info.y / 120.0f;
|
y = input->pointer_curr_axis_info.y / 120.0f;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
y = 0.0f;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clear pointer_curr_axis_info for next frame */
|
/* clear pointer_curr_axis_info for next frame */
|
||||||
SDL_memset(&input->pointer_curr_axis_info, 0, sizeof input->pointer_curr_axis_info);
|
SDL_memset(&input->pointer_curr_axis_info, 0, sizeof input->pointer_curr_axis_info);
|
||||||
|
|
||||||
if(x == 0.0f && y == 0.0f)
|
if (x != 0.0f || y != 0.0f) {
|
||||||
return;
|
|
||||||
else
|
|
||||||
SDL_SendMouseWheel(window->sdlwindow, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
|
SDL_SendMouseWheel(window->sdlwindow, 0, x, y, SDL_MOUSEWHEEL_NORMAL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pointer_handle_axis_source(void *data, struct wl_pointer *pointer,
|
pointer_handle_axis_source(void *data, struct wl_pointer *pointer,
|
||||||
|
|
Loading…
Reference in a new issue