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
This commit is contained in:
arcum42 2010-04-24 23:22:49 +00:00
parent dc4899e65d
commit 790cd55608
1 changed files with 7 additions and 6 deletions

View File

@ -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;