From 790cd55608515bda65e3bdcef3fbf1322bd96c9b Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 24 Apr 2010 23:22:49 +0000 Subject: [PATCH] zzogl-pg: I don't think this should be hardcoded to 640x480... git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2896 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/ZZoglCRTC.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp index 53ba91eb11..2d4c028a4d 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCRTC.cpp @@ -121,14 +121,13 @@ void ZeroGS::AdjustTransToAspect(Vector& v) { double temp; float f; - int dispwidth = 640; - int dispheight = conf.isWideScreen ? 360 : 480; - if( dispwidth * nBackbufferHeight > dispheight * nBackbufferWidth) { + if (conf.width * nBackbufferHeight > conf.height * nBackbufferWidth) + { // limited by width // change in ratio - f = ((float)nBackbufferWidth / (float)dispwidth) / ((float)nBackbufferHeight / (float)dispheight); + f = ((float)nBackbufferWidth / (float)conf.width) / ((float)nBackbufferHeight / (float)conf.height); v.y *= f; v.w *= f; @@ -136,9 +135,11 @@ void ZeroGS::AdjustTransToAspect(Vector& v) v.y += (1-(float)modf(v.y*(float)nBackbufferHeight*0.5f+0.05f, &temp))*2.0f/(float)nBackbufferHeight; v.w += (1-(float)modf(v.w*(float)nBackbufferHeight*0.5f+0.05f, &temp))*2.0f/(float)nBackbufferHeight; } - else { + else + { // limited by height - f = ((float)nBackbufferHeight / (float)dispheight) / ((float)nBackbufferWidth / (float)dispwidth); + + f = ((float)nBackbufferHeight / (float)conf.height) / ((float)nBackbufferWidth / (float)conf.width); f -= (float)modf(f*nBackbufferWidth, &temp)/(float)nBackbufferWidth; v.x *= f; v.z *= f;