Example #1
0
void BumpDraw( HWND hWindow )
/***********************************************************************/
{
	LPVIDEO lpVideo;
	if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) )
		return;

	RECT SRect = SrcRect;
	RECT DRect = DstRect;
	int iZoomFactor = (int)GetSwitchValue( 'z', lpVideo->lpSwitches );
	if ( !iCount )
	{
		SRect.top += 10;
		DRect = SRect;
		ScaleRect( &DRect, iZoomFactor );
		iCount = 1;
	}
	else
	{
		SRect.top -= 10;
		DRect = SRect;
		ScaleRect( &DRect, iZoomFactor );
		iCount = 0;
	}
	MCIClip( lpVideo->hDevice, &SRect, NULL/*&DRect*/, /*0*/iZoomFactor );
}
Example #2
0
static BOOL Video_OnSizeOrPosChange( HWND hWindow, LPWINDOWPOS lpWindowPos )
/***********************************************************************/
{
	int cx, cy;

	if ( lpWindowPos->flags & SWP_NOSIZE )
		return( FORWARD_WM_WINDOWPOSCHANGING( hWindow, lpWindowPos, DefWindowProc ) );

	LPVIDEO lpVideo;
	if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) )
		return( YES );
	if ( !lpVideo->hDevice )
		return( YES );

	RECT SrcRect;
	MCIGetSrcRect( lpVideo->hDevice, &SrcRect );
	MCIClip( lpVideo->hDevice, &SrcRect, NULL/*&DstRect*/, lpVideo->iZoomFactor );

	if ( lpVideo->iZoomFactor > 0 )
	{
		cx = RectWidth(&SrcRect)  * lpVideo->iZoomFactor;
		cy = RectHeight(&SrcRect) * lpVideo->iZoomFactor;
	}
	else
	{
		cx = RectWidth(&SrcRect)  / (-lpVideo->iZoomFactor);
		cy = RectHeight(&SrcRect) / (-lpVideo->iZoomFactor);
	}

	if ( lpWindowPos->cx == cx && lpWindowPos->cy == cy )
		return( YES );

	RECT rect;
	GetWindowRect( hWindow, &rect );
	POINT pt;
	pt.x = (rect.right + rect.left - cx)/2;
	pt.y = (rect.bottom + rect.top - cy)/2;
	pt.x &= (~3); // For it to live on a 4 pixel (32 bit) boundary
	MapWindowPoints( NULL, GetParent(hWindow), &pt, 1 ); // Map screen to parent
	lpWindowPos->x	= pt.x;
	lpWindowPos->y	= pt.y;
	lpWindowPos->cx = cx;
	lpWindowPos->cy = cy;
	return( NO );
}
Example #3
0
void BumpSet( HWND hWindow, BOOL bOn )
/***********************************************************************/
{
	LPVIDEO lpVideo;
	if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) )
		return;

	if ( !bOn )
	{
		MCIGetSrcRect( lpVideo->hDevice, &SrcRect );
		MCIGetDstRect( lpVideo->hDevice, &DstRect );
	}
	else
	{
		MCIClip( lpVideo->hDevice, &SrcRect, &DstRect, 0/*iZoomFactor*/ );
		iCount = 0;
	}
}