diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 840c3fd1a5..dc83bee411 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -677,15 +677,25 @@ static void d3d_calculate_rect(void *data, if (settings->video.scale_integer && !force_full) { - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; + video_viewport_get_scaled_integer(&vp, *width, *height, - video_driver_get_aspect_ratio(), d3d->keep_aspect); - *x = vp.x; - *y = vp.y; - *width = vp.width; - *height = vp.height; + video_driver_get_aspect_ratio(), + d3d->keep_aspect); + + *x = vp.x; + *y = vp.y; + *width = vp.width; + *height = vp.height; } else if (d3d->keep_aspect && !force_full) { diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index acbf0e3001..138d2b5537 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -1273,9 +1273,20 @@ bool input_wl_state_kb(gfx_ctx_wayland_data_t *wl, const struct retro_keybind ** static int16_t input_wl_pointer_state(gfx_ctx_wayland_data_t *wl, unsigned idx, unsigned id, bool screen) { - bool inside = false; - struct video_viewport vp = {0}; - int16_t res_x = 0, res_y = 0, res_screen_x = 0, res_screen_y = 0; + struct video_viewport vp; + + bool inside = false; + int16_t res_x = 0; + int16_t res_y = 0; + int16_t res_screen_x = 0; + int16_t res_screen_y = 0; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; if (!(video_driver_translate_coord_viewport_wrap(&vp, wl->mouse.x, wl->mouse.y, &res_x, &res_y, &res_screen_x, &res_screen_y))) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 43aca93e15..6793d1dc5d 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -732,10 +732,17 @@ static INLINE int android_input_poll_event_type_motion( for (motion_ptr = 0; motion_ptr < pointer_max; motion_ptr++) { - struct video_viewport vp = {0}; + struct video_viewport vp; float x = AMotionEvent_getX(event, motion_ptr); float y = AMotionEvent_getY(event, motion_ptr); + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; + video_driver_translate_coord_viewport_wrap( &vp, x, y, diff --git a/input/drivers/cocoa_input.c b/input/drivers/cocoa_input.c index 701414e6b4..2ae8609949 100644 --- a/input/drivers/cocoa_input.c +++ b/input/drivers/cocoa_input.c @@ -157,7 +157,15 @@ static void cocoa_input_poll(void *data) for (i = 0; i < apple->touch_count; i++) { - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; + #ifndef IOS apple->touches[i].screen_x *= backing_scale_factor; apple->touches[i].screen_y *= backing_scale_factor; diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 409788ca2c..9443d93717 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -405,12 +405,25 @@ static int16_t dinput_mouse_state_screen(struct dinput_input *di, unsigned id) static int16_t dinput_pointer_state(struct dinput_input *di, unsigned idx, unsigned id, bool screen) { - bool pointer_down, inside; - int x, y; - struct video_viewport vp = {0}; - int16_t res_x = 0, res_y = 0, res_screen_x = 0, res_screen_y = 0; - unsigned num = 0; - struct pointer_status *check_pos = di->pointer_head.next; + struct video_viewport vp; + bool pointer_down = false; + bool inside = false; + int x = 0; + int y = 0; + int16_t res_x = 0; + int16_t res_y = 0; + int16_t res_screen_x = 0; + int16_t res_screen_y = 0; + unsigned num = 0; + struct pointer_status * + check_pos = di->pointer_head.next; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; while (check_pos && num < idx) { diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index eb3dc2bb9f..a729dfa1b1 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -409,9 +409,16 @@ static void qnx_process_touch_event( { if(qnx->pointer[i].contact_id == -1) { - struct video_viewport vp = {0}; + struct video_viewport vp; - qnx->pointer[i].contact_id = contact_id; + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; + + qnx->pointer[i].contact_id = contact_id; video_driver_translate_coord_viewport_wrap( &vp, @@ -469,7 +476,15 @@ static void qnx_process_touch_event( { if(qnx->pointer[i].contact_id == contact_id) { - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; + #if 0 gl_t *gl = (gl_t*)video_driver_get_ptr(false); diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 2d470149db..029fcf1f4a 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -177,9 +177,19 @@ static int16_t sdl_mouse_device_state(sdl_input_t *sdl, unsigned id) static int16_t sdl_pointer_device_state(sdl_input_t *sdl, unsigned idx, unsigned id, bool screen) { - bool inside = false; - struct video_viewport vp = {0}; - int16_t res_x = 0, res_y = 0, res_screen_x = 0, res_screen_y = 0; + struct video_viewport vp; + bool inside = false; + int16_t res_x = 0; + int16_t res_y = 0; + int16_t res_screen_x = 0; + int16_t res_screen_y = 0; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; if (!(video_driver_translate_coord_viewport_wrap(&vp, sdl->mouse_abs_x, sdl->mouse_abs_y, &res_x, &res_y, &res_screen_x, &res_screen_y))) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index afd43b00ff..ced28ebb70 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -461,9 +461,19 @@ static int16_t udev_analog_pressed(const struct retro_keybind *binds, unsigned i static int16_t udev_pointer_state(udev_input_t *udev, unsigned idx, unsigned id, bool screen) { - bool inside = false; - struct video_viewport vp = {0}; - int16_t res_x = 0, res_y = 0, res_screen_x = 0, res_screen_y = 0; + struct video_viewport vp; + bool inside = false; + int16_t res_x = 0; + int16_t res_y = 0; + int16_t res_screen_x = 0; + int16_t res_screen_y = 0; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; if (!(video_driver_translate_coord_viewport_wrap(&vp, udev->mouse_x, udev->mouse_y, &res_x, &res_y, &res_screen_x, &res_screen_y))) diff --git a/input/drivers/x11_input.c b/input/drivers/x11_input.c index 5b3dcc7c59..92c42f02d6 100644 --- a/input/drivers/x11_input.c +++ b/input/drivers/x11_input.c @@ -163,9 +163,19 @@ static int16_t x_mouse_state_screen(x11_input_t *x11, unsigned id) static int16_t x_pointer_state(x11_input_t *x11, unsigned idx, unsigned id, bool screen) { - bool inside; - struct video_viewport vp = {0}; - int16_t res_x = 0, res_y = 0, res_screen_x = 0, res_screen_y = 0; + struct video_viewport vp; + bool inside = false; + int16_t res_x = 0; + int16_t res_y = 0; + int16_t res_screen_x = 0; + int16_t res_screen_y = 0; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; if (!(video_driver_translate_coord_viewport_wrap(&vp, x11->mouse_x, x11->mouse_y, &res_x, &res_y, &res_screen_x, &res_screen_y))) @@ -303,7 +313,14 @@ static void x_input_poll_mouse(x11_input_t *x11) if (x11->grab_mouse && video_driver_is_focused()) { int mid_w, mid_h; - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; video_driver_get_viewport_info(&vp); diff --git a/record/record_driver.c b/record/record_driver.c index ef8e6630c8..654cbd79be 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -200,7 +200,14 @@ void recording_dump_frame(const void *data, unsigned width, if (has_gpu_record) { - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; video_driver_get_viewport_info(&vp); @@ -357,7 +364,14 @@ bool recording_init(void) if (video_driver_supports_recording()) { unsigned gpu_size; - struct video_viewport vp = {0}; + struct video_viewport vp; + + vp.x = 0; + vp.y = 0; + vp.width = 0; + vp.height = 0; + vp.full_width = 0; + vp.full_height = 0; video_driver_get_viewport_info(&vp);