From cd40452e610e32935cfc5bae96cc77209f79e7d9 Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Thu, 7 Jan 2010 03:10:51 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@40064 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfxvideo/draw.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/dfxvideo/draw.c b/plugins/dfxvideo/draw.c index d89d75c2..fe7f87a6 100644 --- a/plugins/dfxvideo/draw.c +++ b/plugins/dfxvideo/draw.c @@ -47,8 +47,6 @@ unsigned short usCursorActive = 0; //unsigned int LUT16to32[65536]; //unsigned int RGBtoYUV[65536]; -float pixelaspect; - #include #include #include @@ -1014,9 +1012,6 @@ void CreateDisplay(void) screen=DefaultScreenOfDisplay(display); - pixelaspect = ((float)DisplayWidth(display, myscreen) / (float)DisplayWidthMM(display, myscreen)) / - ((float)DisplayHeight(display, myscreen) / (float)DisplayHeightMM(display, myscreen)); - root_window_id=RootWindow(display,DefaultScreen(display)); //Look for an Xvideo RGB port @@ -1536,24 +1531,23 @@ void RGB2YUV(uint32_t *s, int width, int height, uint32_t *d) extern time_t tStart; -//Note: dest w,h are both input and output variables +//Note: dest x,y,w,h are both input and output variables inline void MaintainAspect(unsigned int *dx,unsigned int *dy,unsigned int *dw,unsigned int *dh) { //Currently just 4/3 aspect ratio int t; - if (*dw * 3 > (float)*dh * pixelaspect * 4) { - t = (float)*dh * pixelaspect * 4.0f / 3; //new width aspect + if (*dw * 3 > *dh * 4) { + t = *dh * 4.0f / 3; //new width aspect *dx = (*dw - t) / 2; //centering *dw = t; } else { - t = (float)(*dw * 3) / (float)(4.0f * pixelaspect); + t = *dw * 3.0f / 4; *dy = (*dh - t) / 2; *dh = t; } } - void DoBufferSwap(void) { Screen *screen; -- cgit v1.2.3