From 8ca0520d76626f64dbcf8c1c176045067bba9980 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Tue, 19 Mar 2013 21:32:10 +0000 Subject: Patch 14090 (KrossX2); git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83651 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/peopsxgl/draw.c | 3 ++- plugins/peopsxgl/externals.h | 1 + plugins/peopsxgl/gpu.c | 15 +++++++++------ 3 files changed, 12 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/peopsxgl/draw.c b/plugins/peopsxgl/draw.c index a779af27..fd8f4c46 100755 --- a/plugins/peopsxgl/draw.c +++ b/plugins/peopsxgl/draw.c @@ -95,7 +95,8 @@ BOOL bIsFirstFrame = TRUE; int iResX; int iResY; -BOOL bKeepRatio = FALSE; +BOOL bKeepRatio = FALSE; +BOOL bForceRatio43 = FALSE; RECT rRatioRect; // psx mask related vars diff --git a/plugins/peopsxgl/externals.h b/plugins/peopsxgl/externals.h index 4d4aea16..e793549e 100755 --- a/plugins/peopsxgl/externals.h +++ b/plugins/peopsxgl/externals.h @@ -224,6 +224,7 @@ extern HINSTANCE hInst; extern int iResX; extern int iResY; extern BOOL bKeepRatio; +extern BOOL bForceRatio43; extern RECT rRatioRect; extern BOOL bSnapShot; extern BOOL bSmallAlpha; diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index 84d54bcb..d022d19e 100755 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -169,7 +169,7 @@ short imageY0,imageY1; BOOL bDisplayNotSet = TRUE; GLuint uiScanLine=0; int iUseScanLines=0; -float iScanlineColor[] = {0,0,0, 0.3}; // easy on the eyes. +float iScanlineColor[] = {0,0,0, 0.3f}; // easy on the eyes. int lSelectedSlot=0; unsigned char * pGfxCardScreen=0; int iBlurBuffer=0; @@ -1799,17 +1799,20 @@ void ChangeDispOffsetsY(void) // CENTER Y void SetAspectRatio(void) { - float xs,ys,s;RECT r; + float xs,ys,s,resx,resy;RECT r; if(!PSXDisplay.DisplayModeNew.x) return; if(!PSXDisplay.DisplayModeNew.y) return; - xs=(float)iResX/(float)PSXDisplay.DisplayModeNew.x; - ys=(float)iResY/(float)PSXDisplay.DisplayModeNew.y; + resx = bForceRatio43 ? 640.0f : (float)PSXDisplay.DisplayModeNew.x; + resy = bForceRatio43 ? 480.0f : (float)PSXDisplay.DisplayModeNew.y; + + xs=(float)iResX/resx; + ys=(float)iResY/resy; s=min(xs,ys); - r.right =(int)((float)PSXDisplay.DisplayModeNew.x*s); - r.bottom=(int)((float)PSXDisplay.DisplayModeNew.y*s); + r.right =(int)(resx*s); + r.bottom=(int)(resy*s); if(r.right > iResX) r.right = iResX; if(r.bottom > iResY) r.bottom = iResY; if(r.right < 1) r.right = 1; -- cgit v1.2.3