/*****************************************************************************
* events.c: Windows DirectX video output events handler
*****************************************************************************
- * Copyright (C) 2001-2004 VideoLAN (Centrale Réseaux) and its contributors
+ * Copyright (C) 2001-2004 the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
if( i_width && i_height )
{
- val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x )
- * p_event->p_vout->render.i_width / i_width;
+ val.i_int = ( GET_X_LPARAM(msg.lParam) - i_x ) *
+ p_event->p_vout->fmt_in.i_visible_width / i_width +
+ p_event->p_vout->fmt_in.i_x_offset;
var_Set( p_event->p_vout, "mouse-x", val );
- val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y )
- * p_event->p_vout->render.i_height / i_height;
+ val.i_int = ( GET_Y_LPARAM(msg.lParam) - i_y ) *
+ p_event->p_vout->fmt_in.i_visible_height / i_height +
+ p_event->p_vout->fmt_in.i_y_offset;
var_Set( p_event->p_vout, "mouse-y", val );
val.b_bool = VLC_TRUE;
rect_src.bottom = p_vout->render.i_height;
/* Clip the source image */
- rect_src_clipped.left = (rect_dest_clipped.left - rect_dest.left) *
- p_vout->render.i_width / (rect_dest.right - rect_dest.left);
- rect_src_clipped.right = p_vout->render.i_width -
- (rect_dest.right - rect_dest_clipped.right) * p_vout->render.i_width /
- (rect_dest.right - rect_dest.left);
- rect_src_clipped.top = (rect_dest_clipped.top - rect_dest.top) *
- p_vout->render.i_height / (rect_dest.bottom - rect_dest.top);
- rect_src_clipped.bottom = p_vout->render.i_height -
- (rect_dest.bottom - rect_dest_clipped.bottom) * p_vout->render.i_height /
- (rect_dest.bottom - rect_dest.top);
+ rect_src_clipped.left = p_vout->fmt_out.i_x_offset +
+ (rect_dest_clipped.left - rect_dest.left) *
+ p_vout->fmt_out.i_visible_width / (rect_dest.right - rect_dest.left);
+ rect_src_clipped.right = p_vout->fmt_out.i_x_offset +
+ p_vout->fmt_out.i_visible_width -
+ (rect_dest.right - rect_dest_clipped.right) *
+ p_vout->fmt_out.i_visible_width / (rect_dest.right - rect_dest.left);
+ rect_src_clipped.top = p_vout->fmt_out.i_y_offset +
+ (rect_dest_clipped.top - rect_dest.top) *
+ p_vout->fmt_out.i_visible_height / (rect_dest.bottom - rect_dest.top);
+ rect_src_clipped.bottom = p_vout->fmt_out.i_y_offset +
+ p_vout->fmt_out.i_visible_height -
+ (rect_dest.bottom - rect_dest_clipped.bottom) *
+ p_vout->fmt_out.i_visible_height / (rect_dest.bottom - rect_dest.top);
/* Apply overlay hardware constraints */
if( p_vout->p_sys->b_using_overlay )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args );
- f_arg = va_arg( args, double );
-
/* Update dimensions */
rect_window.top = rect_window.left = 0;
- rect_window.right = p_vout->i_window_width * f_arg;
- rect_window.bottom = p_vout->i_window_height * f_arg;
+ rect_window.right = p_vout->i_window_width;
+ rect_window.bottom = p_vout->i_window_height;
AdjustWindowRect( &rect_window, p_vout->p_sys->i_window_style, 0 );
SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,